移植boost到hi3519

来源:互联网 发布:苹果屏幕录像软件 编辑:程序博客网 时间:2024/06/06 07:36

1.编译环境

  • Ubuntu16.04 + arm-hisiv500-linux-gcc
  • 下载地址: http://sourceforge.net/projects/boost/files/boost/

2.移植步骤

  • 新建安装目录:mkdir install
  • 运行安装包自带脚本:./bootstrap.sh --prefix=/home/shunzhi/software/boost/boost_1_64_0/install
  • 修改project-config.jam文件,具体修改如下:
10 if ! gcc in [ feature.values <toolset> ]11 {12     using gcc : arm : arm-hisiv500-linux-gcc ; #注意中间空格13 }
  • 编译安装:./bjam install toolset=gcc-arm --layout=tagged --build-type=complete --prefix=/home/shunzhi/software/boost/boost_1_63_0/install

3.测试程序:

#include<iostream>#include<boost/lexical_cast.hpp>int main()  {     int a = boost::lexical_cast<int>("1008611");     std::cout << a <<std::endl;     return 0;  }
  • 编译测试程序:arm-hisiv500-linux-g++ boost_test.cpp -L ../stage/lib/ -I ../ -o test

注意:

  • option.set prefix :(交叉编译器所在位置);
  • option.set exec-prefix :(交叉编译器所在位置)/bin ;
  • option.set libdir :(交叉编译器所在位置)/lib ;
  • option.set includedir :(交叉编译器所在位置)/include
1 0
原创粉丝点击