fatal error: Eigen/Geometry: 没有那个文件或目录
时间: 2024-01-17 13:01:48 浏览: 231
This error message means that the compiler was not able to find the header file "Eigen/Geometry". This file is part of the Eigen C++ library, which provides a set of linear algebra routines.
To fix this error, you need to make sure that the Eigen library is properly installed on your system and that the compiler knows where to find it. This can be done by adding the appropriate include directories to your compiler's search path.
Here are the steps that you can follow to fix this error:
1. Download the Eigen library from the official website (https://eigen.tuxfamily.org/index.php?title=Main_Page).
2. Extract the downloaded archive to a directory of your choice.
3. In your C++ code, add the following line at the top of your file:
#include <Eigen/Geometry>
4. When compiling your code, make sure to add the directory where the Eigen library is installed to the include search path. For example, if you extracted the library to a directory called "eigen-3.3.9", you can compile your code with the following command:
g++ -I /path/to/eigen-3.3.9 my_program.cpp -o my_program
Note that the "-I" option tells the compiler to add the specified directory to the include search path.
5. Run your program and verify that the error message is no longer displayed.
阅读全文