zoukankan      html  css  js  c++  java
  • XCode5/Apple LLVM 5.0下使用boost的方法

    Because Apple changes the compiler to llvm only in XCode5, so there are some compatible problems with the boost library compiled by old gcc , I tried several days, and get the result, we must set the compiler to clang.

    1. download newest boost sourcecode from http://sourceforge.net/projects/boost/files/boost/1.54.0/


    2. use tar to uncompress it, then execute ./bootstrap.sh --prefix=/Users/dotphoenix/Public/boost toolset=clang

    we set the install path to /Users/dotphoenix/Public/boost , changes it to yours, the very important is set compiler to clang


    3. ./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


    the static libraries are installed at /Users/dotphoenix/Public/boost/lib, and the headers are installed at /Users/dotphoenix/Public/boost/include


    4. add the library path and the header path at Build Settings->Search Paths, then Add files to ...


    中文:

    因为XCode5 完全切换到了LLVM,丢弃了GCC,所以使用旧版本GCC编译的boost库会出现load library的错误(dylib/dlopen???不是太明白原因),所以必须使用LLVM重新编译库,最好是编译成静态的,上面的步骤就是做这个事情的。


  • 相关阅读:
    PAT A1108 Finding Average [字符串处理]
    PAT A1013 Battle Over Cities [图的遍历]
    关于斐波那契数列的算法
    关于浏览器的事件队列
    类型与进制转换
    【待整理】python 关键字
    闭包和函数的自运行
    cookie-cart购物车
    有意思的效果——左右摇摆
    工厂模式
  • 原文地址:https://www.cnblogs.com/pangblog/p/3348125.html
Copyright © 2011-2022 走看看