Ubuntu 15.04 clang++ 3.6 编译boost 1.59/1.55
2015-10-03 12:44
169 查看
Ubuntu 15.04已经可以直接通过apt-get insall 安装clang 3.6, 并且预装的gcc版本是4.9.2。这些安装过程在这里介绍。
首先下载boost源码
wget -O boost.1.59.tar.bz2 http://sourceforge.net/projects/boost/files/latest/download?source=files 解压
tar jxvf ./boost.1.59.tar.bz2
指定clang工具,生成编译脚本
./bootstrap.sh --with-libraries=system,filesystem,log,atomic,thread,program_options --with-toolset=clang
编译并安装
./b2 toolset=clang cxxflags="-std=c++11"
sudo ./b2 install --prefix=/usr
等一会儿就好。
要注意的是,boost 1.59 似乎有问题,因为编译安装之后,我的一个简单的使用boost log的程序编译会报错,错误如下:
clang++ -g -std=c++11 -I../include -Wall -DBOOST_LOG_DYN_LINK -o
./object/main.cc.o -c ../src/main.cc In file included from
../src/main.cc:8: In file included from ../include/helper/logger.h:16:
In file included from /usr/include/boost/log/sinks.hpp:25: In file
included from /usr/include/boost/log/sinks/async_frontend.hpp:42: In
file included from
/usr/include/boost/log/sinks/unbounded_fifo_queue.hpp:29: In file
included from /usr/include/boost/log/detail/event.hpp:25: In file
included from /usr/include/boost/atomic/capabilities.hpp:18: In file
included from /usr/include/boost/atomic/detail/platform.hpp:22:
/usr/include/boost/atomic/detail/gcc-atomic.hpp:35:67: error: unknown
type name 'memory_order' BOOST_FORCEINLINE BOOST_CONSTEXPR int
convert_memory_order_to_gcc(memory_order order) BOOST_NOEXCEPT
/usr/include/boost/atomic/detail/gcc-atomic.hpp:37:22: error: use of
undeclared identifier 'memory_order_relaxed'
当我降级到boost 1.55.0后,问题消失。
首先下载boost源码
wget -O boost.1.59.tar.bz2 http://sourceforge.net/projects/boost/files/latest/download?source=files 解压
tar jxvf ./boost.1.59.tar.bz2
指定clang工具,生成编译脚本
./bootstrap.sh --with-libraries=system,filesystem,log,atomic,thread,program_options --with-toolset=clang
编译并安装
./b2 toolset=clang cxxflags="-std=c++11"
sudo ./b2 install --prefix=/usr
等一会儿就好。
要注意的是,boost 1.59 似乎有问题,因为编译安装之后,我的一个简单的使用boost log的程序编译会报错,错误如下:
clang++ -g -std=c++11 -I../include -Wall -DBOOST_LOG_DYN_LINK -o
./object/main.cc.o -c ../src/main.cc In file included from
../src/main.cc:8: In file included from ../include/helper/logger.h:16:
In file included from /usr/include/boost/log/sinks.hpp:25: In file
included from /usr/include/boost/log/sinks/async_frontend.hpp:42: In
file included from
/usr/include/boost/log/sinks/unbounded_fifo_queue.hpp:29: In file
included from /usr/include/boost/log/detail/event.hpp:25: In file
included from /usr/include/boost/atomic/capabilities.hpp:18: In file
included from /usr/include/boost/atomic/detail/platform.hpp:22:
/usr/include/boost/atomic/detail/gcc-atomic.hpp:35:67: error: unknown
type name 'memory_order' BOOST_FORCEINLINE BOOST_CONSTEXPR int
convert_memory_order_to_gcc(memory_order order) BOOST_NOEXCEPT
/usr/include/boost/atomic/detail/gcc-atomic.hpp:37:22: error: use of
undeclared identifier 'memory_order_relaxed'
当我降级到boost 1.55.0后,问题消失。
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- ubuntu下chrome无法同步问题解决
- Ubuntu Linux使用体验
- 使用 GNOME 优化工具自定义 Linux 桌面的 10 种方法
- 以Ubuntu 9.04为例 将工作环境迁移到 Linux
- VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹
- 从USB安装Ubuntu Server 10.04.3 图文详解
- Ubuntu 15.04 正式版发布下载
- Linux-Ubuntu 10.04安装Cadence-ic610 方法总结图解
- Ubuntu 12.04和Windows 7双系统安装图解
- 开机出现:grub rescue的修复方法
- Ubuntu连接Android真机调试
- 你应该选择 Ubuntu 还是 Fedora?
- 100 个最佳 Ubuntu 应用(中)
- 看看我的Ubuntu Linux截图
- Ubuntu 12.04 LTS服务器版安装过程及使用图解
- Windows 7/8/8.1 硬盘安装 Ubuntu 14.04 实现双系统