简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM