type
status
date
slug
summary
password
tags
category
icon
1.环境
- 平台:Windows 10
- 编译器:mingw,gcc/g++
- CMake
- Eigen版本:3.4.0
2.编译安装
1.官网下载源码
2.打开 cmake-gui 配置编译安装环境
- where is the source code 处选择刚刚下载并解压的源码文件夹,在同级目录新建一个 build 文件夹,在 where to build the binaries 处选择该文件夹。
- 点击Configure
- 设置编译器(很关键):
Specify the generator for this project:
MinGW Makefiles
Specify native compilers
Next
Compilers C:
E:\MinGW-w64\x64-4.8.1-release-posix-seh-rev5\mingw64\bin\gcc.exe
Compilers C++:
E:\MinGW-w64\x64-4.8.1-release-posix-seh-rev5\mingw64\bin\g++.exe
Finish
- 由于 cmake-gui 生成的默认安装路径有问题,所以我们要自己进行修改,将 INCLUDE_INSTALL_DIR 变量设置为源码的路径,比如我源码的路径是 D:/eigen-3.4.0 ,我就要填上 eigen-3.4.0 (注意使用//分割路径;非完整路径,而是eigen-3.4.0的上级路径一起写)。如下图所示。
- 点击Configure ==》》Generate
3.程序中使用Eigen
1.CMakeLists.txt
2.测试程序
下图输出则成功:

4.其它问题
linux或者arm架构下的需要手动安装:
5.参考链接
- 作者:cherryhua
- 链接:https://blog.cherrylord.com/article/post-38
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。