You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to compile, I get lots of "multiple definition of <something>'" errors.
This is because e.g. PHL.h defines int WHITE and thus every file which #includes PHL.h has a definition of int white, which confuses the linker. The correct version is to put int WHITE in PHL.c, while PHL.h has only a declaration (extern int WHITE). SCU would work too.
Not sure why it compiles on some compilers, IMO it should not...
This problem too many times for me to fix it correctly (lots of definitions in game.h), so I have just added add_link_options("-Wl,--allow-multiple-definition") to CMakeLists.txt, which appears to work, but probably not the correct fix.
The text was updated successfully, but these errors were encountered:
When I try to compile, I get lots of "multiple definition of
<something>
'" errors.This is because e.g. PHL.h defines
int WHITE
and thus every file which #includes PHL.h has a definition ofint white
, which confuses the linker. The correct version is to putint WHITE
in PHL.c, while PHL.h has only a declaration (extern int WHITE
). SCU would work too.Not sure why it compiles on some compilers, IMO it should not...
This problem too many times for me to fix it correctly (lots of definitions in game.h), so I have just added
add_link_options("-Wl,--allow-multiple-definition")
to CMakeLists.txt, which appears to work, but probably not the correct fix.The text was updated successfully, but these errors were encountered: