Re: Windows gtk programming



On Wednesday 08 February 2006 21:28, Tor Lillqvist wrote:
Gorshkov writes:
 > gcc `pkg-config --libs gtk+-win32-2.0` test.o -o test
 > test.o(.text+0x41):test.c: undefined reference to `gtk_init_abi_check'
 > test.o(.text+0x46):test.c: undefined reference to `gtk_main'

You are very close, and seem to know well what you doing, congrats!
Except for one small thing:

You need to have the libraries after the object files, otherwise they
won't be searched for the symbols that are left undefined after
linking in the object files. This is how it has traditionally always
been in Unix. It's just Linux (and other ELF-based systems?) that is
sloppy and allows undefined symbols in executables (to be bound by the
run-time linker). (Or does GNU ld on Linux re-search the libraries
mentioned after linking in the object files mentioned?)

It is also customary to have the -o and output file name before the
object files and libraries, but that's just convention.

--tml

ummm ..... oops? :-)
I knew it was something stupid ..... I *hate* it when that happens. 
thanks :-)



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