Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Multiple definition of raygui functions #92

Open
the-argus opened this issue Mar 5, 2023 · 1 comment
Open

Multiple definition of raygui functions #92

the-argus opened this issue Mar 5, 2023 · 1 comment

Comments

@the-argus
Copy link

Related to #49 I think, it's basically the same problem but with raygui.

Issue

Using raygui causes multiple definition errors for symbols defined in raygui headers.

Steps to reproduce

Clone https://github.com/the-argus/hampster-game at commit af08b1f61a02b89bf12d19aca6e2dca52bf0c9e7 and run nimble build -d:nimraylib_now_shared --threads=on (I used the shared lib since I'm on nixOS).
Alternatively, if you have nix installed, just enter the directory and run nix run.

Error log

I'm not going to paste the whole thing, but its just this over and over for all the raygui functions:

Output: /nix/store/lz1bwpdvlywij5ir0fmncgqa83dlpwhn-binutils-2.39/bin/ld: /home/argus/.cache/nim/hampster_game_d/@mhampster_game.nim.c.o: in function `GuiEnable':
        ... @mhampster_game.nim.c:(.text+0x0): multiple definition of `GuiEnable'; /home/argus/.cache/nim/hampster_game_d/@mui.nim.c.o:@mui.nim.c:(.text+0x0): first defined here
        ... /nix/store/lz1bwpdvlywij5ir0fmncgqa83dlpwhn-binutils-2.39/bin/ld: /home/argus/.cache/nim/hampster_game_d/@mhampster_game.nim.c.o: in function `GuiDisable':
        ... @mhampster_game.nim.c:(.text+0x11): multiple definition of `GuiDisable'; /home/argus/.cache/nim/hampster_game_d/@mui.nim.c.o:@mui.nim.c:(.text+0x11): first defined here
        ... /nix/store/lz1bwpdvlywij5ir0fmncgqa83dlpwhn-binutils-2.39/bin/ld: /home/argus/.cache/nim/hampster_game_d/@mhampster_game.nim.c.o: in function `GuiLock':
        ... @mhampster_game.nim.c:(.text+0x22): multiple definition of `GuiLock'; /home/argus/.cache/nim/hampster_game_d/@mui.nim.c.o:@mui.nim.c:(.text+0x22): first defined here
@greenfork
Copy link
Owner

I guess I will have to prioritize the re-write to a single C file. This issue seems to be too ubiquitous. Thank you for this bug report!

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

No branches or pull requests

2 participants