Using boost from XCODE 4.6.1 - what are the correct build settings?

I downloaded boost 1.53 and was extracted to users / user / Desktop / boost_1_53_0 I successfully created boost as static libraries following the instructions: http://libcinder.org/docs/v0.8.5/_cinder_boost.html

I changed the XCODE "Build Settings" "Header Search Paths" to / Users / user / Desktop / boost _1_53_0, as well as the "Library Search Paths" for users / users / Desktop / boost_1_53_0 / stage / lib

Then I create and get errors:

The first error I get is "has_binary_operator.hpp". Question parameter. Expected Member Name or ";" after the declaration qualifiers in the line:

template <typename Lhs, typename Rhs>

struct operator_exists {

...

Does anyone have any tips on customizing the build? The project contains several cocoa / object C (.m) files and others that are C ++ (. Mm) using boost. I am completely new to trying to use boost under OSX mountain lion and XCODE 4.6.1.

+4
source share
4 answers

I'm a little late for this, but in case anyone else has this problem ...

I had this problem with an increase in projects using Objective C. I would get syntactic and semantic problems in has_binary_operator.hpp and lexical_cast.hpp.

A quick fix inserted a “#undef check” before including formatting headers in the Objective-C source files, as it would seem that “validation” is a reserved word in Objective-C.

+1
source

You can set the GNU98 compiler type or something similar, the default XCODE4 compiler can be compatible with C ++ 11

0
source

I am using boost from XCODE and I agree with fatih_k. I have all the c and C ++ language settings set in GNU99 and GNU ++ 98. I also have the option "Compile Sources As", which is set to "According to the type of file."

I found that the projects I create always use Objective-C by default, so maybe just configure your project and make sure you have everything configured for C ++, not Objective-C.

I have not tried the C ++ 11 options with boost yet.

0
source

The default compiler of Xcode 4.x is llvm, and libC ++ is used by default. You can change the settings in Xcode

To change stdlib as libc ++

a. Select a target from Xcode and go to the BuildSettings tab.

b. Go to Apple LLVM Compiler 4.2 - Language Option

Change the parameter as libstd from libC ++

To change the compiler

a. Select a target from Xcode and go to the BuildSettings tab.

b. Go down Build Options

Change the C / C ++ / Objective-C parameter - the default will be "Apple LLVM Compiler 4.2". Change it to g ++ 4.2

0
source

Source: https://habr.com/ru/post/1482885/


All Articles