|
From: Nathan S. <nat...@pk...> - 2009-03-14 10:02:58
|
Nathan Schulte wrote: > Hey all, I'm working on a project involving DirectShow and GTK+. I > recently setup a fresh MSYS and MinGW environment on a laptop I am using > to build the project with. > > The issue is that whenever I try to compile and link the simplest code > (like the gtkmm hello world example) as follows: > > g++ `pkg-config --libs --cflags gtkmm-2.4` main.cpp > > all I get are a bunch of linker errors, as though it's not even trying > to link. pkg-config outputs the proper goods, and the paths are > correct, so I know that's working right. > > However, when I issue the same command (copying and pasting the goods > from pkg-config of course) in a command prompt (CMD.exe), it compiles > and links no problem. I cannot figure out why this is. Having to > switch back and forth between shells is a pain, and using pkg-config is > a real time saver. > > Does anyone know why this may be happening? > > -Nathan > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com I have found the issue. It seems as though any -l options need to come _after_ the source files. g++ main.cpp `pkg-config --libs --cflags gtkmm-2.4` is ok, but gt++ `pkg-config --libs --cflags gtkmm-2.4` main.cpp is not. The command I was piecing together in the dos prompt had main.cpp before the pkg-config output, causing the effect I described, but not because of why I described. Is this a bug, or is this how gcc/g++ work? |