Hello, I recently installed windows again and am trying to get geany going. It works, but I can't get the gtk+ libraries to link. I can compile a project if I paste the output of `pkg-config --cflags gtk+-2.0` (taken from msys). If I paste the output of `pkg-config --cflags --libs gtk+-2.0` (because it gives me errors if I omit --cflags there) in Build (in Set Includes and Arguments) it gives me this:
"gcc" -Wall -o "hello" "hello.c" -mms-bitfields -IC:/gtk/include/gtk-2.0 -IC:/gtk/lib/gtk-2.0/include -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include -IC:/gtk/include/libpng12 -LC:/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 (in directory: C:\Users\user\Desktop) C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x50): undefined reference to `gtk_init_abi_check' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x5c): undefined reference to `gtk_window_new' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x82): undefined reference to `g_object_set' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0xa5): undefined reference to `g_object_set' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0xb8): undefined reference to `g_type_check_instance_cast' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0xe8): undefined reference to `g_signal_connect_data' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0xf4): undefined reference to `gtk_label_new' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0xfc): undefined reference to `gtk_container_get_type' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x10b): undefined reference to `g_type_check_instance_cast' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x11c): undefined reference to `gtk_container_add' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x127): undefined reference to `gtk_widget_show_all' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x12c): undefined reference to `gtk_main' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x144): undefined reference to `gtk_widget_destroy' C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x149): undefined reference to `gtk_main_quit' collect2: ld returned 1 exit status , Compilation failed.
Does anyone know how I can get this to work in geany? I can command line compile with cmd.exe if I make an environment variable and do "gcc filename.c -o exename.exe %GTK_FLAGS%" but I can't use the variable (or it's content) to get apps to build in geany. Any help is appreciated, Thanks,
Josh
On Sun, 2 Aug 2009 06:03:52 +0000 (UTC), joshua.rh@comcast.net wrote:
Hi,
"gcc" -Wall -o "hello" "hello.c" -mms-bitfields -IC:/gtk/include/gtk-2.0 -IC:/gtk/lib/gtk-2.0/include -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include -IC:/gtk/include/libpng12 -LC:/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 (in directory: C:\Users \user\Desktop) C:\Users\user\AppData\Local\Temp/ccsaGSpV.o:hello.c: (.text+0x50): undefined reference to `gtk_init_abi_check' C:\Users\user \AppData\Local\Temp/ccsaGSpV.o:hello.c:(.text+0x5c): undefined reference to `gtk_window_new'
these errors are most probably caused because some libs are missing or not found. But in any case independent from Geany. Maybe you want to have a look at Geany's src/makefile.win32 in the source tarball, there is a list of necessary libraries and linker flags, for Geany.
Does anyone know how I can get this to work in geany? I can command line compile with cmd.exe if I make an environment variable and do "gcc filename.c -o exename.exe %GTK_FLAGS%" but I can't use the variable (or it's content) to get apps to build in geany. Any help is appreciated, Thanks,
This seems to be the same request you posted some wees ago (http://lists.uvena.de/pipermail/geany/2009-July/004753.html) :). I had a look and added some code to expand system environment variables, see SVN r4050. If you don't build Geany yourself on Windows, wait until Monday, 05:00 UTC and download the nightly binary from http://nightly.geany.org to test it.
There seems to be a problem with expanded paths which contain spaces, i.e. a quoting problem. I'm not yet sure where this happens and how to fix it, but for paths without quotes it should work already.
HTH, Enrico