[Glade-users] gtk+ and glade on windows -> native .exe files, link time errors



Hello,

Since the application I am building needs to be portable, I need to produce
the corresponding .exe files for windows users. So, I just installed cygwin
with all the requirements pointed out at http://gladewin32.sourceforge.net/
and managed to compile a small GTK+ application to produce an executable.

Then I proceeded to install glade 2.4 as provided on that site. So I downloaded
some gtk/libglade code with the scp utility which I got from cygwin (could also
have used wget), downloaded gvim for windows (because I couldn't stand not
being able to cut and paste code with the default cygwin terminal window),
and wrote and compiled a sample hello world file as outlined on
http://gladewin32.sf.net/. This worked fine.

I then tried to compile my small glade test app. Here is the Makefile:

------------ Makefile
------------------------------------------------------------------

CXX=g++

CXXFLAGS=-mms-bitfields -mno-cygwin -mwindows

all: test

test: main.o
        ${CXX} -o test `pkg-config --libs gtk+-2.0 libglade-2.0` \
                       main.o

main.o: main.cpp
        ${CXX} ${CXXFLAGS} -c `pkg-config --cflags gtk+-2.0 libglade-2.0` \
        main.cpp

-------------------------------------------------------

Now when I type make to produce the object file main.o I get the object file
no problem, but then when I get to the link phase I end up with the following
errors:

main.o(.text+0xe):main.c: undefined reference to `_g_print'
main.o(.text+0x21):main.c: undefined reference to `_gtk_widget_show_all'
main.o(.text+0x35):main.c: undefined reference to `_gtk_widget_hide'
main.o(.text+0x41):main.c: undefined reference to `_g_print'
main.o(.text+0x3e69):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x3e93):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x3ea3):main.c: undefined reference to
`_g_type_check_instance_cast'
main.o(.text+0x3ed5):main.c: undefined reference to `_g_signal_connect_data'
main.o(.text+0x3f81):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x3fab):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x3fbb):main.c: undefined reference to
`_g_type_check_instance_cast'
main.o(.text+0x3fed):main.c: undefined reference to `_g_signal_connect_data'
main.o(.text+0x4105):main.c: undefined reference to `_gtk_init_abi_check'
main.o(.text+0x4121):main.c: undefined reference to `_glade_xml_new'
main.o(.text+0x413b):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x4155):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x416f):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x4189):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x41a3):main.c: undefined reference to `_glade_xml_get_widget'
main.o(.text+0x41bd):main.c: more undefined references to
`_glade_xml_get_widget' follow
main.o(.text+0x498a):main.c: undefined reference to `_gtk_main'
collect2: ld returned 1 exit status
make: *** [whm] Error 1

Any ideas of how to fix this problem?

Thanks,

Neil




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]