I am attempting to statically link to the IUP UI library, using their provided MinGW binaries. I’ve been able to figure it out except for 3 linker errors. Which seem to be compiler implementation specific? I’ve had trouble digging up information on this. Any help would be greatly appreciated.
error: lld-link: undefined symbol: __declspec(dllimport) __argc
note: referenced by libiup.a(iupwindows_main.o):(.refptr.__imp___argc)
error: lld-link: undefined symbol: __declspec(dllimport) __argv
note: referenced by libiup.a(iupwindows_main.o):(.refptr.__imp___argv)
error: lld-link: undefined symbol: _setjmp
note: referenced by libiup.a(iup_maskparse.o):(iupMaskParse)
I hit the same error yesterday while trying to link a static library that was built with an older zig version.
I’m guessing this was caused by a recent update of of mingw64 in the zig compiler Update mingw-w64 to latest git commit by andrewrk · Pull Request #16109 · ziglang/zig · GitHub
I could solve this by rebuilding the static library with the same zig version. But that would be pretty complicated in your case, I guess.
So I’d suggest that you report this problem on github and either use an older zig version or dynamically link the library until the issue is fixed.
Thank you for this insight. Will try reporting this soon and see if there’s a workaround for linking to older builds from MinGW. But I’ll just do dynamic linking for now. Much appreciated!