• 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重新编译库,最好是编译成静态的,上面的步骤就是做这个事情的。


  • 相关阅读:
    WSL配置c语言环境
    vue无法获取$store中的变量
    接口自动化中全局参数以及用例信息
    正则表达式
    vue-i18n web 前端国际化
    elementui默认样式修改的问题
    setTimeOut的使用以及this指向问题
    elementui 在表格表头里面添加按钮
    各种
    element ui tabs标签页动态增加标签页,标签页引用组件
  • 原文地址:https://www.cnblogs.com/pangblog/p/3348125.html
Copyright © 2020-2023  润新知