I'm sorry there was a very old thread that referenced the problem with no resolution--the good news is I've narrowed it down:
For context, the issue is I've installed QuantLib, which is an open source financial library and built it's libraries. When I compile from the command line, everything works perfectly, however I can not get XCode to successfully link. More confusing is that other libraries (for example, the Boost library) are installed in the same location and compile and build fine.
I'm running Xcode 3.1.1 under 10.5.5. I've succesfully, I believe, narrowed the problem to one flag:
-D_GLIBCXX_DEBUG=1
Compiling with the following--which is the compile statement that Xcode produces (with some extraneous '-I' flags remove for readability):
> /Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -I/usr/local/include -c main.cpp -o /Users/me/sandbox/QLtest/build/QLtest.build/Debug/QLtest.build/Objects-normal/i386/main.o and then linking, with the linking statement Xcode generates, leads to build errors, whereas:
> /Developer/usr/bin/gcc-4.0 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_GLIBCXX_DEBUG_PEDANTIC=1 -I/usr/local/include -c main.cpp -o /Users/me/sandbox/QLtest/build/QLtest.build/Debug/QLtest.build/Objects-normal/i386/main.o
is successful.
So the question is now--what is -D_GLIBCXX_DEBUG=1 and how to get XCode to drop the -D_GLIBCXX_DEBUG=1 ?
Thank you.
Bart.
On Dec 18, 2008, at 12:37 AM, Chris Espinosa wrote: On Dec 17, 2008, at 12:23 PM, Bart Mosley, bondgeek.com wrote: If this command line compile/link works (note this is run in the project directory for Xcode and main.cpp is now just a "Hello, World" with #include<ql/quantlib.hpp> added to it) :
c++ main.cpp -o tql -L/usr/local/lib -lQuantLib
Then why won't does Xcode get 15 (and only 15) build errors? If I remove the library, so that I know it's not linking, I get 290 symbols not found.
It seems to have something to do with the -filelist option for g++, because if I take the compile and linking commands from the error window and run them in a command window...I can isolate that the problem to that, I think.
Was there a prior context for this question that we missed? I can't make heads or tails of it. Chris
|