11

has anyone setup a C++ Xcode4 project to use Boost? what settings do I need to set in Xcode for a simple C++ console application?

Thanks

pingu
  • 8,719
  • 12
  • 50
  • 84

3 Answers3

19

Managed it with this:

Link binaries with libraries

and this:

enter image description here

pingu
  • 8,719
  • 12
  • 50
  • 84
  • where did u get the libboost_system.dylib ? I need system and thread. can you share it please? or share with us how you get it? – eugene Apr 11 '11 at 10:15
  • It was copied over as part of the install process I followed here http://www.boost.org/doc/libs/1_46_1/more/getting_started/unix-variants.html – pingu Apr 11 '11 at 21:13
  • I got an error saying "image not found". What resolved this, was that I added the necessary files to the output by selecting "Targets" and then "Build Phases". Then, under "Copy Files", I added "libboost_filesystem.dylib" and "libboost_system.dylib" to the "Products Directory" (select from "Destination" dropdown). No subfolder needed – conciliator Feb 25 '13 at 20:09
6

I would just like to add on to the previous post:

After running

$ sudo port install boost (this can be done once you have macports installed).

libboost_system.dylib and libboost_filesystem.dylib could be found in /opt/local/lib/

boost_1_46_1.tar.bz2 will be located in /opt/local/var/macports/distfiles/boost/ Unarchive it, then copy and paste the folder named "Boost" to /usr/local/include/

Raunak
  • 3,314
  • 1
  • 22
  • 28
2
  1. Download the boost libraries for unix from : http://www.boost.org/
  2. Unzip it : Let's say now you have boost in "($USER_NAME)/boost_X_YY_0"
  3. Open your console Application project
  4. Click on top left node in the project directory pane (left hand side). This should be your project name
  5. Build Settings -> Search Paths -> Header Search Paths ->Add the "($USER_NAME)/boost_X_YY_0" path
  6. #include "boost/any.hpp" will work
abnvp
  • 1,037
  • 11
  • 19