Reputation: 20472
I have an installation of minGW which works well for building straightfowrd C++ programs.
Now I am installing GTK, following the instructions here: http://www.gtk.org/download/win32_tutorial.php
I have grabbed a GTK hellow world program from here: https://developer.gnome.org/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD
but when I try to build it, using this command
C:\Users\James\code\smartone>gcc -o hello.exe gtk_hello_world.c -mms-bitfields
IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/
tk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixman-1 -IC:/gtk/in
lude -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng15 -IC:
gtk/include/gdk-pixbuf-2.0 -IC:/gtk/include/libpng15 -IC:/gtk/include/glib-2.0
IC:/gtk/lib/glib-2.0/include -LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshe
l32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig
lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk
pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
I get these errors
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible C:/gtk/lib/libgtk-3.dll.a when searching
for -lgtk-3
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible C:/gtk/lib/libgtk-3.dll.a when searching
for -lgtk-3
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: cannot find -lgtk-3
... etc, etc, etc
What have I missed?
Upvotes: 1
Views: 886
Reputation: 11454
You are using a 64 bits compiler. Build with your 64 bits compiler in 32 bits mode with gcc's -m32 option.
Upvotes: 3