I want to use boost in my Xcode project.(Xcode version 4.3.2)
I had build the boost from the MacPorts, and made the environment variables set.
But when I build the prj, there was the error:
Unknown type name 'namespace'
and the error code below:
// This file is automatically generated. Do not edit.
// ['../../libs/compatibility/generate_cpp_c_headers.py']
// Wed Jul 23 12:11:19 2003 ('GMTST', 'GMTST')
#ifndef __CSTDDEF_HEADER
#define __CSTDDEF_HEADER
#include <stddef.h>
namespace std {
using ::ptrdiff_t;
using ::size_t;
}
#endif // CSTDDEF_HEADER
the auto generated code is C++, not Objective-C. Objective-C compiler rejects the invalid keyword 'namespace'.
To make it work change you project settings as follows: - go to you Project Settings and choose the Target - select Build Settings -> Apple LLVM compiler X.X - Language -> Compile Sources As and set it to Objective-C++ which allows mixture of Objective-C and C++.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With