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

1.3.0 mingw build failure on win10 #406

Open
shellohunter opened this issue Jan 18, 2025 · 4 comments
Open

1.3.0 mingw build failure on win10 #406

shellohunter opened this issue Jan 18, 2025 · 4 comments

Comments

@shellohunter
Copy link

Im using mginw32, having these sdl libs installed:

mingw-w64-ucrt-x86_64-SDL2 2.30.10-1
mingw-w64-ucrt-x86_64-SDL2_gfx 1.0.4-2
mingw-w64-ucrt-x86_64-SDL2_image 2.8.2-3
mingw-w64-ucrt-x86_64-SDL2_mixer 2.8.0-2
mingw-w64-ucrt-x86_64-SDL2_ttf 2.22.0-1

got errors as below. it looks like cimgui-go was linking some static libs shipped with the package?

C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\shello\AppData\Local\Temp\go-link-2712737066\000009.o: in function `_cgo_3cdcbea75483_Cfunc_SDL_GameControllerGetSteamHandle':
/tmp/go-build/cgo-gcc-prolog:546:(.text+0x5e6): undefined reference to `SDL_GameControllerGetSteamHandle'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/shello/go/pkg/mod/github.com/!allen!dang/[email protected]/backend/../lib/windows/x64/libSDL2.a(SDL_hidapi.c.obj):SDL_hidapi.c:(.text+0x106e): undefined reference to `__imp_SetupDiGetClassDevsA'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/shello/go/pkg/mod/github.com/!allen!dang/[email protected]/backend/../lib/windows/x64/libSDL2.a(SDL_hidapi.c.obj):SDL_hidapi.c:(.text+0x1081): undefined reference to `__imp_SetupDiEnumDeviceInterfaces'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/shello/go/pkg/mod/github.com/!allen!dang/[email protected]/backend/../lib/windows/x64/libSDL2.a(SDL_hidapi.c.obj):SDL_hidapi.c:(.text+0x1088): undefined reference to `__imp_SetupDiGetDeviceInterfaceDetailA'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/shello/go/pkg/mod/github.com/!allen!dang/[email protected]/backend/../lib/windows/x64/libSDL2.a(SDL_hidapi.c.obj):SDL_hidapi.c:(.text+0x116f): undefined reference to `__imp_SetupDiEnumDeviceInfo'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/shello/go/pkg/mod/github.com/!allen!dang/[email protected]/backend/../lib/windows/x64/libSDL2.a(SDL_hidapi.c.obj):SDL_hidapi.c:(.text+0x117e): undefined reference to `__imp_SetupDiGetDeviceRegistryPropertyA'
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/shello/go/pkg/mod/github.com/!allen!dang/[email protected]/backend/../lib/windows/x64/libSDL2.a(SDL_hidapi.c.obj):SDL_hidapi.c:(.text+0x133c): undefined reference to `__imp_SetupDiEnumDeviceInterfaces'
...........
...........
...........

found similar report here:
any idea?

@gucio321
Copy link
Collaborator

@shellohunter which code are youb uilding? As far as I see it is something about SDL. Does it origin from sdl backend or imgui itself?

@gucio321
Copy link
Collaborator

also, lemma say: our github CI can't reproduce https://github.com/AllenDang/cimgui-go/actions/runs/12464437434/job/34788540130

@shellohunter
Copy link
Author

@gucio321

I'm building a cimgui-go demo with the ebiten backend.
As far as I can tell, the link script were linking to the static lib under cimgui-go/lib.
Those missing symbols were not found from [email protected]\lib\windows\x64\libSDL2.a, but they do exists in the lib installed by mingw, as below:

for example, GameControllerGetSteamHandle was reported missing.

PS > dumpbin.exe .\libSDL2.a | grep GameControllerGetSteamHandle


PS > nm C:\msys64\ucrt64\lib\libSDL2.dll.a | grep GameControllerGetSteamHandle
0000000000000000 I __imp_SDL_GameControllerGetSteamHandle
0000000000000000 T SDL_GameControllerGetSteamHandle

while GameControllerGetAxis was found in both libs.

PS > dumpbin.exe .\libSDL2.a | grep GameControllerGetAxis
          10 .rdata$.refptr.SDL_GameControllerGetAxisFromString_REAL
          10 .rdata$.refptr.SDL_GameControllerGetAxis_REAL


PS > nm C:\msys64\ucrt64\lib\libSDL2.dll.a | grep GameControllerGetAxis
0000000000000000 I __imp_SDL_GameControllerGetAxisFromString
0000000000000000 T SDL_GameControllerGetAxisFromString
0000000000000000 I __imp_SDL_GameControllerGetAxis
0000000000000000 T SDL_GameControllerGetAxis

a few questions:

  • what's the version of static libs like [email protected]\lib\windows\x64\libSDL2.a? maybe out of sync?
  • I can see 2 cimgui-go were installed into my go dir. they have the same content. but the 2nd one has a ! mark inside the path. so, why they two? and why the exclamation mark here?
    • C:\Users\shello\go\pkg\mod\github.com!allen!dang\[email protected]\lib\windows\x64\libSDL2.a
    • C:\Users\shello\go\pkg\mod\github.com\allendang\[email protected]\lib\windows\x64\libSDL2.a

@gucio321
Copy link
Collaborator

what's the version of static libs like [email protected]\lib\windows\x64\libSDL2.a? maybe out of sync?

They are compiled from thirdparty/ clones of these libraries so they shhould match imgui version as well.

I can see 2 cimgui-go were installed into my go dir. they have the same content. but the 2nd one has a ! mark inside the path. so, why they two? and why the exclamation mark here?

Generally this is a question to @golang

Could you try to:

  • clone this repo
  • clean go cache
  • run examples/glfw (or examples/ebiten)

First of all this should not try to build SDL backend so no symbols confusion should happen

More questions:

  • what go version
  • what mingw version
  • what SDL version comes with this mingw? (C:\msys64\ucrt64\lib\libSDL2.dll.a)

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