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

Win64 static build - undefined ref in project #878

Open
Unbrecht opened this issue Mar 27, 2024 · 0 comments
Open

Win64 static build - undefined ref in project #878

Unbrecht opened this issue Mar 27, 2024 · 0 comments

Comments

@Unbrecht
Copy link

Unbrecht commented Mar 27, 2024

I tried to build a static gd library on Windows 10 64bit. The cmake build was successfully finished. When I link libgd.a and libjpeg.a to my project I get undefined references to all used functions from example code (i.e. __imp_gdImageCreate). Example: https://libgd.github.io/manuals/2.3.3/files/preamble-txt.html (I removed png functions).

If I build on unix 64bit as static lib it works.
If I build a dll it works too.

Cmake command, equal in both machines:
cmake -G "MinGW Makefiles" .. -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIB=OFF -DENABLE_JPEG=1 -DJPEG_LIBRARY=C:\\MinGW64\\bin\\proj\\_EXT_LIBS\\libgd\\libgd-master\\module\\jpeg\\libs\\libjpeg.a -DJPEG_INCLUDE_DIR=C:\\MinGW64\\bin\\proj\\_EXT_LIBS\\libgd\\libgd-master\\module\\jpeg

Linking in project:
gcc %pname%%val%.c -I%pname%\libgd\libgd -L%pname%\libgd -l:libgd.a -l:libjpeg.a -lm -o %pname%%exe%.exe

My gcc is from Mingw64
I tried V2.3.3 and the actual git project from yesterday.
Extracting the libgd.a with nm.exe shows that all function should be avialable. But are undefined when used.
I also tried to build with MSYS (supporting perl) but the result is the same.

Following the cmake result:
_result.txt

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

1 participant