Using Boost with Xcode4

11,883

Solution 1

Managed it with this:

Link binaries with libraries

and this:

enter image description here

Solution 2

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/

Solution 3

  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
Share:
11,883

Related videos on Youtube

pingu
Author by

pingu

Updated on May 24, 2022

Comments

  • pingu
    pingu almost 2 years

    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

  • eugene
    eugene about 13 years
    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?
  • pingu
    pingu about 13 years
    It was copied over as part of the install process I followed here boost.org/doc/libs/1_46_1/more/getting_started/…
  • conciliator
    conciliator about 11 years
    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