Hi

I am trying to build gtk hello world application from 
 
http://forge.novell.com/modules/xfmod/cvs/cvsbrowse.php/helloworld/helloworld.tar.gz?tarball=1

I had problems in PKG_CHECK_MODULES(DEPS, gtk+-2.0 >= 2.2 glib-2.0 >= 2.2) 
command of configure
so I needed to disable that before running ./configure
As a result need to add required libraries and include files manually to 
Makefiles.

With following include and link changes to makefile I am able to compile 
everything but linking still fails.
-I /usr/include/gtk-2.0 -I /usr/include/glib-2.0 -I /usr/include/pango-1.0 
 -I /lib/glib-2.0/include -I /lib/gtk-2.0/include -I /usr/include/atk-1.0
and
-L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 
-lpangoxft-1.0 -lXft -lfreetype -lz -lXrender -lXext -l
fontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 
-lglib-2.0 -lintl -liconv

The exact error I get is following

$ make
make  all-recursive
make[1]: Entering directory 
`/cygdrive/c/cygwin/home/lamikr/helloworld/module5'
Making all in src
make[2]: Entering directory 
`/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src'
gcc  -g -O2  -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 
-lgdk_pixbuf-2.0 -lpangoxft-1.0 -lXft -lfreetype -lz -lXrender -lXext -l
fontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 
-lglib-2.0 -lintl -liconv -o hello.exe  main.o
main.o: In function `main':
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:20: undefined 
reference to `_gtk_init_abi_check'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:23: undefined 
reference to `_gtk_window_new'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:26: undefined 
reference to `_gtk_container_get_type'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:26: undefined 
reference to `_g_type_check_instance_cast'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:26: undefined 
reference to `_gtk_container_set_border_width'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:29: undefined 
reference to `_gtk_window_get_type'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:29: undefined 
reference to `_g_type_check_instance_cast'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:29: undefined 
reference to `_gtk_window_set_title'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:32: undefined 
reference to `_g_type_check_instance_cast'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:32: undefined 
reference to `_gtk_window_set_default_size'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:35: undefined 
reference to `_gtk_window_set_default_icon_from_file'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:41: undefined 
reference to `_g_type_check_instance_cast'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:41: undefined 
reference to `_g_signal_connect_data'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:44: undefined 
reference to `_gtk_label_new'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:47: undefined 
reference to `_g_type_check_instance_cast'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:47: undefined 
reference to `_gtk_container_add'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:50: undefined 
reference to `_gtk_widget_show_all'
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:53: undefined 
reference to `_gtk_main'
main.o: In function `on_destroy':
/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src/main.c:11: undefined 
reference to `_gtk_main_quit'
collect2: ld returned 1 exit status
make[2]: *** [hello.exe] Error 1
make[2]: Leaving directory 
`/cygdrive/c/cygwin/home/lamikr/helloworld/module5/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 
`/cygdrive/c/cygwin/home/lamikr/helloworld/module5'
make: *** [all] Error 2

Do you know what changes are needed to "gcc  -g -O2  -L/usr/X11R6/lib 
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 
-lXft -lfreetype -lz -lXrender -lXext -l
fontconfig -lpangox-1.0 -lX11 -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 
-lglib-2.0 -lintl -liconv -o hello.exe  main.o" command?

Mika

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/

Reply via email to