cmake_minimum_required(VERSION 3.5) project(MyEigenProject) # Find the Eigen3 package find_package(Eigen3 REQUIRED NO_MODULE) add_executable(main main.cpp) # Link the Eigen3 target target_link_libraries(main Eigen3::Eigen) Use code with caution.
Modern C++ projects on Ubuntu frequently use CMake to manage dependencies. Eigen provides native CMake support, making it easy to find and link. eigen download ubuntu
Since it is header-only, you can simply copy the Eigen folder to /usr/local/include to make it available system-wide: sudo cp -r eigen-3.4.0/Eigen /usr/local/include Use code with caution. cmake_minimum_required(VERSION 3