|
From: Keith M. <kei...@us...> - 2009-03-14 22:45:52
|
On Saturday 14 March 2009 10:08:52 Tor Lillqvist wrote: > > g++ `pkg-config --libs --cflags gtkmm-2.4` main.cpp > > Try this instead: > > g++ `pkg-config --cflags gtkmm-2.4` main.cpp `pkg-config --libs > gtkmm-2.4` > > > pkg-config outputs the proper goods, > > Not really. In general one should put libraries after object (or, > in your simple case, source) files on the command line. That is how > it has traditionally been since the dawn of time. It's just on > Linux (and other platforms that use ELF?) that one can put > libraries before the object files. So unfortunately this > "pkg-config --cflags --libs" meme is very widespread. Unfortunate indeed. Even on Linux, this common misuse is incorrect; it is only when the libraries in question are *shared*, that the ELF linker will forgive the incorrect ordering; such misuse, in the case of *static* libraries, will be punished equally on all platforms. -- Regards, Keith. |