简体   繁体   中英

Do XCode projects need special settings to use pre-compiled boost libraries?

I have just installed boost for the first time on my Intel Mac, and it works fine in general, as long as I use only boost's header files.

But when I try to use a lib, in my case the regex lib, my app links and launches fine, but then it soon crashes in a regex related destructor.

This even happens with the simple test program that's given on boost.org's unix install page .

I wonder if I need to set special compile/link options (I've used the defaults for a C++ Tool) other than setting the search paths and including the regex lib, of course?

(BTW, I have verified that the default compiler on my system is indeed gcc 4.01, which is the same my test project in XCode uses)

I know this thread is old, but now even with Boost 1.53 this still happens. I was answered in an another later thread—cross-linking in case someone finds this one via Google or other search.

Recompiling with the C++11 option does the trick. Apparently that is not default with clang.

Answer to self:

While it's still not clear what causes this problem, there is a workaround:

Instead of using the libs that the boost installer process builds, add the source code for the lib (in boost-main-folder/libs/ libname /src/) to your Xcode project instead, having Xcode compile the sources for you.

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