当前位置:网站首页>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
边栏推荐
- Educational Codeforces Round 117 (Rated for Div. 2)E. Messages
- Insect operator overloaded a fun
- Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
- Wechat applet SetData dynamic variable value sorting
- How to call self written functions in MATLAB
- d检查类型是指针
- 【系统分析师之路】第十五章 复盘数据库系统(数据库案例分析)
- Never use redis expired monitoring to implement scheduled tasks!
- 证券开户安全吗,有没有什么危险啊
- ThreadLocal巨坑!内存泄露只是小儿科...
猜你喜欢

What is the use of index aliases in ES

Installation and uninstallation of MySQL software for windows

9项规定6个严禁!教育部、应急管理部联合印发《校外培训机构消防安全管理九项规定》

Variable declaration of typescript

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

2021-10-18 character array

C language | file operation and error prone points

Zero basics of C language lesson 8: Functions

Basic type of typescript

Free machine learning dataset website (6300+ dataset)
随机推荐
Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
Hard (magnetic) disk (I)
[MySQL from introduction to mastery] [advanced part] (II) representation of MySQL directory structure and tables in the file system
Variable declaration of typescript
Record: why is there no lightning 4 interface graphics card docking station and mobile hard disk?
Is expression of D
Pointer
Never use redis expired monitoring to implement scheduled tasks!
Mathematical design D12 according to string function
布局管理器~登录界面的搭建实例
hands-on-data-analysis 第三单元 模型搭建和评估
使用 Performance 看看浏览器在做什么
Educational Codeforces Round 117 (Rated for Div. 2)E. Messages
d的is表达式
Bug memory management
Matlab programming related knowledge
Wechat applet Registration Guide
I met the problem of concurrent programming in an interview: how to safely interrupt a running thread
AGCO AI frontier promotion (6.26)
数学建模经验分享:国赛美赛对比/选题参考/常用技巧