Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on gcc-10 (-fno-common changes) #7

Open
trofi opened this issue May 12, 2022 · 0 comments
Open

Build fails on gcc-10 (-fno-common changes) #7

trofi opened this issue May 12, 2022 · 0 comments

Comments

@trofi
Copy link

trofi commented May 12, 2022

gcc-10 changed the default from -fcommon to fno-common:
https://gcc.gnu.org/PR85678

As a result build fails as:

   ld: sprite.o:/build/0verkill/data.h:171: multiple definition of `obj_attr'; server.o:/build/0verkill/data.h:171: first defined here
   ld: sprite.o:/build/0verkill/data.h:142: multiple definition of `weapon_name'; server.o:/build/0verkill/data.h:142: first defined here
   ld: hash.o:/build/0verkill/data.h:187: multiple definition of `weapon'; server.o:/build/0verkill/data.h:187: first defined here
   ld: hash.o:/build/0verkill/data.h:171: multiple definition of `obj_attr'; server.o:/build/0verkill/data.h:171: first defined here
   ld: hash.o:/build/0verkill/data.h:142: multiple definition of `weapon_name'; server.o:/build/0verkill/data.h:142: first defined here
   ld: error.o:/build/0verkill/data.h:187: multiple definition of `weapon'; server.o:/build/0verkill/data.h:187: first defined here
   ld: error.o:/build/0verkill/data.h:171: multiple definition of `obj_attr'; server.o:/build/0verkill/data.h:171: first defined here
   ld: error.o:/build/0verkill/data.h:142: multiple definition of `weapon_name'; server.o:/build/0verkill/data.h:142: first defined here

The fix would normally to leave only extern declaration of the variable in header files and move definition to .c files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant