当前位置:网站首页>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
边栏推荐
- 近期比较重要消息
- 基于PyTorch的生成对抗网络实战(7)——利用Pytorch搭建SGAN(Semi-Supervised GAN)生成手写数字并分类
- AGCO AI frontier promotion (6.26)
- [scoi2016] lucky numbers
- In insect classes and objects
- Wechat applet SetData dynamic variable value sorting
- How to check if a text field is empty or not in swift
- [cqoi2015] task query system
- 虫子 内存管理 下 内存注意点
- Logical operation
猜你喜欢

免费的机器学习数据集网站(6300+数据集)

Calculate the distance between two points (2D, 3D)

Codeforces Global Round 21A~D

Stream常用操作以及原理探索

Postman自动化接口测试

常用控件及自定义控件

Never use redis expired monitoring to implement scheduled tasks!

Cloudcompare - Poisson reconstruction

Related knowledge of libsvm support vector machine

C language | file operation and error prone points
随机推荐
Codeforces Global Round 21A~D
Select tag - uses the default text as a placeholder prompt but is not considered a valid value
AGCO AI frontier promotion (6.26)
Formal parameters vs actual parameters
I met the problem of concurrent programming in an interview: how to safely interrupt a running thread
Calculate the distance between two points (2D, 3D)
Codeforces Global Round 21A~D
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
PHP非对称加密算法(RSA)加密机制设计
证券开户安全吗,有没有什么危险啊
Design of PHP asymmetric encryption algorithm (RSA) encryption mechanism
[wc2006] director of water management
Pytorch based generation countermeasure Network Practice (7) -- using pytorch to build SGAN (semi supervised GaN) to generate handwritten digits and classify them
Applicable and inapplicable scenarios of mongodb series
Svn commit error after deleting files locally
Network remote access using raspberry pie
Niuke challenge 48 e speed instant forwarding (tree over tree)
Correlation analysis related knowledge
Embedded virlog code running process
同花顺股票开户选哪个证券公司是比较好,比较安全的