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

[Linux] Can't compile, multiple definition issue #23

Open
ExperiBass opened this issue Aug 13, 2021 · 2 comments
Open

[Linux] Can't compile, multiple definition issue #23

ExperiBass opened this issue Aug 13, 2021 · 2 comments

Comments

@ExperiBass
Copy link

ExperiBass commented Aug 13, 2021

Logs:

make SAM git:(master) ✗

gcc -Wall -Os -c src/reciter.c

gcc -Wall -Os -c src/sam.c

gcc -Wall -Os -c src/render.c

gcc -Wall -Os -c src/main.c

src/main.c: In function ‘main’:

src/main.c:233:9: warning: ‘strncat’ specified bound 256 equals destination size [-Wstringop-overflow=]

233 | strncat(input, "[", 256);

  |         ^~~~~~~~~~~~~~~~~~~~~~~~    

src/main.c:237:12: warning: ‘strncat’ specified bound 256 equals destination size [-Wstringop-overflow=]

237 | } else strncat(input, "\x9b", 256);

  |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~    

gcc -Wall -Os -c src/debug.c

gcc -o sam reciter.o sam.o render.o main.o debug.o

/usr/bin/ld: sam.o:(.bss+0x3e1): multiple definition of `X'; reciter.o:(.bss+0x1): first defined here

/usr/bin/ld: sam.o:(.bss+0x3e0): multiple definition of `Y'; reciter.o:(.bss+0x0): first defined here

/usr/bin/ld: sam.o:(.bss+0x3e2): multiple definition of `A'; reciter.o:(.bss+0x2): first defined here

collect2: error: ld returned 1 exit status

make: *** [Makefile:14: sam] Error 1

System info: EndeavourOS, Linux 5.14.0-rc5-1-mainline #1 SMP PREEMPT Mon, 09 Aug 2021 10:28:23 +0000 x86_64 GNU/Linux

gcc v11.1.0
ld v2.36.1
@ExperiBass
Copy link
Author

Fixed with #19 apparently

@tyomitch
Copy link

tyomitch commented Mar 2, 2022

Alternatively, fixed with #14

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

2 participants