当前位置:网站首页>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
边栏推荐
- Applicable and inapplicable scenarios of mongodb series
- Use performance to see what the browser is doing
- 基于PyTorch的生成对抗网络实战(7)——利用Pytorch搭建SGAN(Semi-Supervised GAN)生成手写数字并分类
- Bug STL string
- When drawing with origin, capital letter C will appear in the upper left corner of the chart. The removal method is as follows:
- C language | file operation and error prone points
- Memory considerations under bug memory management
- Svn commit error after deleting files locally
- Linear basis count (k large XOR sum)
- 免费的机器学习数据集网站(6300+数据集)
猜你喜欢

What is the use of index aliases in ES

Jenkins build prompt error: eacces: permission denied

ThreadLocal巨坑!内存泄露只是小儿科...

Postman自动化接口测试

ThreadLocal giant pit! Memory leaks are just Pediatrics

I met the problem of concurrent programming in an interview: how to safely interrupt a running thread

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

A must for programmers, an artifact utools that can improve your work efficiency n times

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

Zero basics of C language lesson 8: Functions
随机推荐
虫子 类和对象 上
Pycharm远程连接服务器来跑代码
虫子 运算符重载的一个好玩的
[cqoi2015] task query system
Wechat applet SetData dynamic variable value sorting
Mathematical design D12 according to string function
D check type is pointer
Difference between classification and regression
[path of system analyst] Chapter 15 double disk database system (database case analysis)
[wc2006] director of water management
Solutions to the failure of last child and first child styles of wechat applet
Codeforces Round #765 (Div. 2) D. Binary Spiders
CVPR 2022文档图像分析与识别相关论文26篇汇集简介
Never use redis expired monitoring to implement scheduled tasks!
Bucket of P (segment tree + linear basis)
Related knowledge of libsvm support vector machine
A solution to the problem that the display of newff function in neural network cannot be converted from double to struct
[scoi2016] lucky numbers
Installation and uninstallation of MySQL software for windows
character constants