I gave up on linking to Boost Program Options in Xcode, because I couldn't get it to work. I figured out how to get the headers to be recognized, but I'm not familiar enough with how to set up the paths to the libraries to link to in Xcode.
I used Boost and Eclipse in college last year, so I thought I'd be able to sort it out a little easier if I just used Eclipse for this project. My program looks a lot like the example they provide (first.cpp). If you feel the need to look at the source I have it loaded on github.
Don't worry, I have Boost installed in /usr/local/boost:
new-host-2:$ ls | grep program_options
libboost_program_options.a
libboost_program_options.dylib
new-host-2:$ pwd
/usr/local/boost_1_49_0/stage/lib
I have my Project settings configured for Boost in the following ways under Project > Properties > C/C++ General > Paths & Symbols: Includes: /usr/local/boost_1_49_0/ Libraries: boost_program_options Library Paths: /usr/local/boost_1_49_0/stage/lib
Based on the Eclipse console, you would think it linked properly, as I get this output last:
Building target: FizzBuzz
Invoking: Cross G++ Linker
g++ -L/usr/local/boost_1_49_0/stage/lib -o "FizzBuzz" ./Fizzbuzz.o ./main.o -lboost_program_options
Finished building target: FizzBuzz
**** Build Finished ****
However, when I go to run my program, I get a dialog box that says: "Unable to Launch" The selection could not be launched, and there are no recent launches.
I tried running it from the command line, with no luck:
new-host-2:$ ./FizzBuzz
dyld: Library not loaded: libboost_program_options.dylib
Referenced from: /Users/per001/Documents/workspace/FizzBuzz/Debug/./FizzBuzz
Reason: image not found
Trace/BPT trap: 5
How do I set this up to link properly in Eclipse? Or even better, Xcode?