当前位置:网站首页>Eigen(3):error: ‘Eigen’ has not been declared
Eigen(3):error: ‘Eigen’ has not been declared
2022-06-26 13:18:00 【biter0088】
在编译c++文件时,报错:
error: ‘Eigen’ has not been declared

解决方案示例:
CMakeLists.txt中
注意下面四处带有“#”
cmake_minimum_required(VERSION 2.8.3)
project(xxx)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g")
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
nav_msgs
sensor_msgs
roscpp
rospy
rosbag
std_msgs
image_transport
cv_bridge
tf
pcl_conversions
)
include_directories("/usr/local/include/eigen3")#eigen3路径
set(PCL_DIR "/usr/share/pcl-1.8")
set(OpenCV_DIR "/usr/share/OpenCV")
find_package(Eigen3 REQUIRED)#查找eigen3包
find_package(PCL REQUIRED)
find_package(OpenCV 3.2 REQUIRED)
find_package(Ceres REQUIRED)
include_directories(
# include
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}#将eigen3目录包括进来
${CERES_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS})
catkin_package(
CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy std_msgs pcl_conversions
DEPENDS EIGEN3 PCL #作为依赖
# INCLUDE_DIRS include
)cpp文件中
在头文件中对应添加
#include <Eigen/Dense>在下面这个ros answer中,提出引用头文件:
#include <eigen3/Eigen/Eigen>#include <Eigen/Eigen>我试了,不好用(或许也可以试试)
Eigen libriary does not work - ROS Answers: Open Source Q&A Forum
边栏推荐
- Exercises under insect STL string
- 8.Ribbon负载均衡服务调用
- 虫子 内存管理 上
- 虫子 运算符重载的一个好玩的
- 9 articles, 6 interdits! Le Ministère de l'éducation et le Ministère de la gestion des urgences publient et publient conjointement neuf règlements sur la gestion de la sécurité incendie dans les établ
- Knowledge about adsorption
- 【HCSD应用开发实训营】一行代码秒上云评测文章—实验过程心得
- Difference between classification and regression
- Win10 home vs pro vs enterprise vs enterprise LTSC
- Traverse the specified directory to obtain the file name with the specified suffix (such as txt and INI) under the current directory
猜你喜欢

Use performance to see what the browser is doing

Stream常用操作以及原理探索

7.consul service registration and discovery

Logical operation

AGCO AI frontier promotion (6.26)

CloudCompare——泊松重建

array

Gartner 2022年顶级战略技术趋势报告

基于PyTorch的生成对抗网络实战(7)——利用Pytorch搭建SGAN(Semi-Supervised GAN)生成手写数字并分类

Generation and rendering of VTK cylinder
随机推荐
Basic type of typescript
Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
Design of PHP asymmetric encryption algorithm (RSA) encryption mechanism
9 regulations and 6 prohibitions! The Ministry of education and the emergency management department jointly issued the nine provisions on fire safety management of off campus training institutions
CloudCompare——泊松重建
D中不用GC
"Scoi2016" delicious problem solution
Difference between classification and regression
Stream常用操作以及原理探索
C language | the difference between heap and stack
Go language - pipeline channel
Bug STL string
Build your own PE manually from winpe of ADK
[ahoi2005] route planning
服务器创建虚拟环境跑代码
Pytorch based generation countermeasure Network Practice (7) -- using pytorch to build SGAN (semi supervised GaN) to generate handwritten digits and classify them
虫子 类和对象 中
9项规定6个严禁!教育部、应急管理部联合印发《校外培训机构消防安全管理九项规定》
Range of types
常用控件及自定义控件