Build Boost on Mac with Xcode

前端 未结 7 497
长发绾君心
长发绾君心 2020-12-05 11:09

I\'ve recently got acquainted with Boost library and I\'d like to use it in my Xcode project. But sadly there is no HowTo or FAQ on how to do it :(

What\'s the seque

相关标签:
7条回答
  • 2020-12-05 11:40

    For most of the boost libraries, there's nothing to build, it's all in header files. The remainder of the instructions are here.

    0 讨论(0)
  • 2020-12-05 11:42

    Currently I'm very happy with using Pete Goodliffe's script which builds a framework from the Boost source package for both iOS and Mac. Drag and drop it into a project and it works!

    There are multiple versions of the script out there. Here's one: https://gist.github.com/faithfracture/c629ae4c7168216a9856/61be257e1c0839c85743777d0687becad9913bf7

    0 讨论(0)
  • 2020-12-05 11:46

    To build boost on a mac, follow the unix variants getting started page (http://www.boost.org/doc/libs/1_39_0/more/getting_started/unix-variants.html). You won't use Xcode directly to perform the build, but once complete you can add the boost include paths and dylib's to your Xcode project.

    0 讨论(0)
  • 2020-12-05 11:46

    I found that to build Boost 1.41.1 on MacOS, you need to do the following:

    1. Download boost 1.46.1 from here: http://sourceforge.net/projects/boost/files/boost/1.46.1/
    2. Unpack the file
    3. Open terminal, cd to the install directory, and do the following:

    chmod u+x configure.sh

    cd tools/build/v2/engine/src

    chmod u+x build.sh

    Then go back to the install directory, and:

    ./configure.sh

    If that runs successfully, it will tell you to run:

    ./bjam

    That's it.. for whatever reason, I needed to set those permissions manually before it would work.

    0 讨论(0)
  • 2020-12-05 11:48

    I don't know how to use Boost from XCode (I'm not a Mac programmer), but building boost is usually done through their own build tool, bjam.

    They have a guide to building boost here, and you can download the latest version of bjam here

    Once it is built, you reference it from Xcode the same way you would any other library. The boost/include should be added to your include path, and the libraries in boost/lib can be referenced for the boost libs that require it.

    0 讨论(0)
  • 2020-12-05 11:49

    su - root

    enter root password and then run below as root

    /opt/local/bin/port install boost

    If you have never logged in as root or forgotten your password, here are the steps to reset root password

    http://support.apple.com/kb/HT1528?viewlocale=en_US&locale=en_US

    0 讨论(0)
提交回复
热议问题