Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking to Boost from Xcode

I want to compile an Xcode (version 4.5.2.) project using Boost-library. I have successfully installed Boost on my mac and I got the following message:

The following directory should be added to compiler include paths:
XXX/boost_1_52_0
The following directory should be added to linker library paths:
XXX/boost_1_52_0/stage/lib

How do I add a compiler include path and a linker library path in Xcode? Many thanks.

like image 608
rize Avatar asked Nov 18 '12 21:11

rize


People also ask

How do I link Boost in Xcode?

To include Boost libraries on Xcode project : Select Xcode project > Build Setting. Add /usr/local/boost_1_60_0/include/ to the Header Search Paths. Add /usr/local/boost_1_60_0/lib/ to the Library Search Paths.

How do I import Boost into CPP?

Go to Project properties → C/C++ → General → Additional Include Directories, and add a path to the boost library root (in my case C:\Program Files (x86)\Boost_1_53 ). Include a . hpp file in your sources, like #include <boost/lexical_cast/lexical_cast_old.

How do I link my Boost library to Windows?

6.1 Link From Within the Visual Studio IDEIn Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, e.g. C:\Program Files\boost\boost_1_55_0\lib\. From the Build menu, select Build Solution.

How do you contribute to Boost?

To participate in development, you need to subscribe to the Boost developers' list. Once you've done that, some paths to contribution are: Submit patches for new features or bug fixes. Pick any ticket from our bug tracking system on GitHub and get started.


1 Answers

I should mention the following is for Xcode 4.5.2. You should likely mention which version of Xcode you're using in your question.

  1. In the Project Navigator select your project file (usually at the top)
  2. Given the two view choices of Basic or All, choose All in the view pane.
  3. Locate the Search Paths section in the settings list
  4. Locate the Header Search Paths subsection under Search Paths
  5. Add the path (absolute or relative to the source folder). You can do it for Debug, Release, or Both.

And in case you didn't see it, you can add addition library search paths here as well, same area, subsection Library Search Paths


Updated for Xcode 5.0.2

  1. In the Project Navigator select your project file (usually at the top)
  2. In the right pane is the project configuration panel. Toward the top-left are two sets of selectable radio options. One says Basic or All, choose All. The second says Combined or Levels, choose Combined.
  3. Locate the Search Paths section in the settings list
  4. Locate the Header Search Paths subsection under Search Paths
  5. Add the path (absolute or relative to the source folder). You can do it for Debug, Release, or Both.
like image 54
WhozCraig Avatar answered Oct 02 '22 11:10

WhozCraig