Mac OS Install boost

Source: Internet
Author: User

Just started learning which Luo Jianfeng's "Boost Library full development guide", there are some problems and solutions under Mac OS under boost.

Environment: OS Yosemite (10.10.3)

Xcode:version 6.3

boost:1.58.0


Operation Steps:

    1. Download boost and unzip;

    2. /bootstrap.sh./b2./B2 Install;

    3. Configure in Xcode (console engineering), build setting Add header search Paths and library search Paths (Installation path for step 2), build phases in link Binary with Libraries add LIBBOOST_SYSTEM.A;

    4. Test: Mian function in # include "Boost/asio.hpp", compile.


Error Dyld:library not loaded:libboost_system.dylib referenced from:/users/shaunyi/library/developer/xcode/ Deriveddata/learningboost-djvlfrwiebzlncahwbsrniqfduuu/build/products/debug/learningboost reason:image not found;

You can compile successfully after adding libboost_system.dylib, but the following error will occur when executing: dyld_fatal_error


Cause: Because the XCODE5 completely switched to LLVM and discarded gcc, the boost library compiled with the old version of GCC will have the error of the load library (Dylib/dlopen??? Not too clear why), so you have to recompile the library with LLVM, preferably compiled to static.


Solution:

Use the following command when compiling the Boost library:./bootstrap.sh toolset=clang;./b2 Toolset=clang--without-mpi cxxflags= "-arch i386-arch x86_64- fvisibility=hidden-fvisibility-inlines-hidden-std=c++11-stdlib=libc++-ftemplate-depth=512 "linkflags="-stdlib= Libc++ "link=static Stage Install



Mac OS Install boost

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.