boost交叉编译(arm)
boost交叉编译正常编译交叉编译CmakeLists.txt配置cmake_minimum_required(VERSION 2.8.4)project(leo_gateway)set(CMAKE_CXX_STANDARD 14)set(BOOST_ROOT ${ROOT_DIR}/lib/boost)find_package(Boost REQUIRED COMPONENTS thread f
·
boost交叉编译arm
正常编译
- 解压
tar -zxvf boost_1_73_0.tar.gz
- 查看可选库
cd boost_1_73_0
./bootstrap.sh --show-libraries
- 编译
./bootstrap.sh --with-libraries=filesystem,thread --with-toolset=gcc
使用–with-libraries=list或–without-libraries=list来添加或排除相应的库
这里可以按步骤2筛选库,完成后会生成“b2”
- 安装
./b2 install --prefix=/leo-gateway/lib/boost
交叉编译
- 编译
./bootstrap.sh --with-libraries=filesystem,thread --with-toolset=gcc
- 修改配置文件project-config.jam
if ! gcc in [ feature.values <toolset> ]
{
using gcc : arm : /usr/local/arm/4.8.0/bin/arm-linux-gnueabihf-gcc ;
}
- 编译
./b2
- 安装
./b2 install --prefix=/root/arm/c4
CmakeLists.txt配置
cmake_minimum_required(VERSION 2.8.4)
project(leo_gateway)
set(CMAKE_CXX_STANDARD 14)
set(BOOST_ROOT ${ROOT_DIR}/lib/boost)
find_package(Boost REQUIRED COMPONENTS thread filesystem)
include_directories(${ROOT_DIR}/lib/boost/include)
add_executable(test main.cpp)
#add_executable(leo_gateway main.cpp)
target_link_libraries(test ${Boost_LIBRARIES})
更多推荐
已为社区贡献1条内容
所有评论(0)