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 Samples #851

Open
erincatto opened this issue Nov 30, 2024 · 2 comments
Open

Linux Samples #851

erincatto opened this issue Nov 30, 2024 · 2 comments

Comments

@erincatto
Copy link
Owner

Hello, I have a building issue that I'm sure it's my fault but I can't figure it out, here's what happens.
I'm on archlinux up to date
I clone box2d
I run build.sh
I get this linking error:
/usr/bin/ld: ../shared/libshared.a(random.c.o):(.data+0x0): multiple definition of 'g_seed'; ../shared/libshared.a(human.c.o):(.bss+0x0): first defined here
I checked in human.c but it doesn't redeclare g_seed, so I don't know what to do

Try to get Linux samples building in GitHub actions.

@eam
Copy link

eam commented Dec 1, 2024

I ran into this as well. Quick fix:

 // Global seed for simple random number generator.
-B2_API uint32_t g_seed;
+
+extern uint32_t g_seed;

The issue seems to be related to the difference in handling of B2_API between C/CXX which turns the declaration in random.h into a definition.

tested on clang 18.1.8 and gcc 14.2.1

@erincatto
Copy link
Owner Author

That issue is fixed in #847

I still need to add samples to GitHub actions

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