Fatal error: Cannot redeclare: Difference between revisions From Online Manual

Jump to: navigation, search
No edit summary
mNo edit summary
 
Line 1: Line 1:
After attempting to install a mod you get this error on one or more pages:
Fatal error: Cannot redeclare....
Fatal error: Cannot redeclare....


This means that the mod has been installed (at least) twice. The code has two or more copies of some function and it throws an error when it reaches the second copy and tries to tell the system to "know" the name of the function.
If after attempting to install a mod you see this error on one or more pages, it means that the mod has been installed (at least) twice. The code has two or more copies of some function and it throws an error when it reaches the second copy and tries to tell the system to "know" the name of the function.


What can you do?
To fix this, there are two options:


If you made a backup before you installed the mod, simply restore it.
*If you made a backup before you installed the mod, simply restore it.


If you did not make a backup, you will have to manually parse the mod which is causing the error(s) and then go through each and every edit, making certain to remove any code which is duplicated. (Sometimes the code duplication is not a fatal error, it just duplicates a variable assignment, or the display code - but in all cases, duplicate code causes problems.) Depending on the mod, this may be a time-consuming task.
*If you did not make a backup, you will have to manually parse the mod which is causing the error(s) and then go through each and every edit, making certain to remove any code which is duplicated. (Sometimes the code duplication is not a fatal error, it just duplicates a variable assignment, or the display code, but in all cases duplicate code causes problems). Depending on the mod, this may be a time-consuming task.


Always remember to make a backup before attempting to install a mod.
Always remember to make a backup before attempting to install a mod.


[[Category:FAQ]]
[[Category:FAQ]]

Latest revision as of 09:37, 14 July 2015

Fatal error: Cannot redeclare....

If after attempting to install a mod you see this error on one or more pages, it means that the mod has been installed (at least) twice. The code has two or more copies of some function and it throws an error when it reaches the second copy and tries to tell the system to "know" the name of the function.

To fix this, there are two options:

  • If you made a backup before you installed the mod, simply restore it.
  • If you did not make a backup, you will have to manually parse the mod which is causing the error(s) and then go through each and every edit, making certain to remove any code which is duplicated. (Sometimes the code duplication is not a fatal error, it just duplicates a variable assignment, or the display code, but in all cases duplicate code causes problems). Depending on the mod, this may be a time-consuming task.

Always remember to make a backup before attempting to install a mod.



Advertisement: