1
votes

h Hello everyone. On my Linux machine, I used Glade 3 to generate an XML file. I successfully embedded the XML file in the program, and compiled the GTK+ program using the following command:

gcc -Wall -g `pkg-config --cflags --libs gtk+-2.0` prog.c

The program worked exactly how I wanted it to. However, using Cygwin on Windows, I cannot get this to compile. I have installed MinGW and the Windows GTK+ 2.0 package. They are both on the root of the Z drive. pkg-config works fine, it sends several compiler and linker options to GCC. I'm not getting any "file does not exist" errors, and I have my $PATH set. I'm getting about a dozen "undefined reference" errors. I get an error for every time I call a GTK function. This is what pkg-config outputs:

-mms-bitfields -IZ:/GTK+/include/gtk-2.0 -IZ:/GTK+/lib/gtk-2.0/include -IZ:/GTK+/include/atk-1.0 -IZ:/GTK+/include/cairo -IZ:/GTK+/include/pango-1.0 -IZ:/GTK+/include/glib-2.0 -IZ:/GTK+/lib/glib-2.0/include -IZ:/GTK+/include/libpng12  -LZ:/GTK+/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl  

I should also mention I was able to use the Windows version of Glade 3 to generate the same XML file. What am I doing wrong?

3

3 Answers

1
votes

This has nothing to do with the glade XML file: gcc arguments order is important while building with mingw.

1
votes

I have added a post how to compile gtk+ application for native windows (and not for X windows)? that describes the exact steps you need to compile natively for windows.

0
votes

pkg-config output only tells you it has found the .pc file. You need to ensure that all the headers and libraries required are really there. Please add a sample of the errors you get too.