- 查看版本号
参考链接
dpkg -S /usr/include/boost/version.hpp
- 交叉编译
参考链接
- Bootstrap the build system:
./bootstrap.sh
- Modify the configuration file (project-config.jam) to use the ARM toolchain by replacing the line with using gcc with:
using gcc : arm : arm-linux-gnueabihf-g++ ;
- Build and install the library:
./bjam install toolset=gcc-arm --prefix=/usr/local/boost
- CMakeLists 中使用
参考链接
- 查看版本号
Eigen库版本的定义在/usr/include/eigen3/Eigen/src/Core/util/Macros.h 里面,查看以下字段可以看出使用的版本号为3.3.4。
#define EIGEN_WORLD_VERSION 3 #define EIGEN_MAJOR_VERSION 3 #define EIGEN_MINOR_VERSION 4
- 交叉编译
-
使用cmake-gui进行配置。
(1)设置源代码目录;设置build目录;点击configure;
(2)选择交叉编译按钮;
(3)设置编译器,Target Root一定要选择正确,点击finish;
search位置输入CMAKE_INSTALL_PREFIX,这里默认为/usr/local,不修改会影响主机上原有库的使用。再次点击configure并generate,完毕后关闭cmake-gui。 -
build目录下make
进入build目录下打开终端,输入make开始编译,应该不会报错。 -
sudo make install
直接输入sudo make install命令安装,应该不会报错。 -
简单示例
(1)编写test.cpp
#include#include using namespace Eigen; int main() { Matrix2d a; a<<5,6, 7,8; MatrixXd b(2,2); b<<1,2, 3,4; std::cout<<"a+b=n"< (2)编译程序
arm-linux-gnueabihf-g++ test.cpp -I /usr/local/include/eigen3 -o test.out(3)将test.out上传到开发板
scp test.out [email protected]:/userdata(4)运行程序
./test.outEigen交叉编译主要参考了这篇博客链接。
glog首先在github上下载源代码,然后进行编译;
yaml-cpp
- 交叉编译
glog的交叉编译方法与上文提到的Eigen交叉编译可以使用同样的方法实现,不再赘述;
此外还参考了另一篇博文,也放在这里作为记录。链接首先在github上下载源代码,然后进行编译;
交叉编译
yaml-cpp的交叉编译方法与上文提到的Eigen交叉编译可以使用同样的方法实现,不再赘述;使用示例
可参考链接。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)