on-internet
← Community

How do I help the linker find my libraries when compiling with mingw64?

Stack Overflow ·

I'm compiling with: x86_64-w64-mingw32-gcc -w -std=c23 -pedantic $(pkg-config --cflags --libs gtk4) coeus.c -o coeus.exe I have mingw64-gtk4 installed. At the linking sage, LD complains of not being able to find any of the functions I use from the gtk library, including with g_object, cairo, pango, etc. e.g. /usr/lib/gcc/x86_64-w64-mingw32/14.2.1/../../../../x86_64-w64-mingw32/bin/ld: /tmp/ccqtQwmb.o:coeus.c:(.text+0x26b0f): undefined reference to `__imp_g_object_unref' I have tried: Specifying the library path explicitly when I execute GCG with -L/usr/x86_64-w64-mingw32/sys-root/mingw/include

Comments

Sign in or sign up to comment and upvote.

No comments yet.