当前位置:网站首页>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
边栏推荐
- Generation and rendering of VTK cylinder
- Educational Codeforces Round 117 (Rated for Div. 2)E. Messages
- Insect operator overloaded a fun
- [MySQL from introduction to mastery] [advanced part] (II) representation of MySQL directory structure and tables in the file system
- MySQL | basic commands
- VTK 圆柱体的生成与渲染
- Gartner 2022年顶级战略技术趋势报告
- 使用 Performance 看看浏览器在做什么
- 爱可可AI前沿推介(6.26)
- Assert and constd13
猜你喜欢
Select tag - uses the default text as a placeholder prompt but is not considered a valid value
Jenkins build prompt error: eacces: permission denied
A must for programmers, an artifact utools that can improve your work efficiency n times
Hard (magnetic) disk (I)
Knowledge about the determination coefficient R2 and the relationship with the correlation coefficient
How to call self written functions in MATLAB
Stream常用操作以及原理探索
Exercise set 1
Included angle of 3D vector
Codeforces Global Round 21A~D
随机推荐
Select tag - uses the default text as a placeholder prompt but is not considered a valid value
证券开户安全吗,有没有什么危险啊
FreeFileSync 文件夹比较与同步软件
Hard (magnetic) disk (II)
Mathematical design D12 according to string function
【HCSD应用开发实训营】一行代码秒上云评测文章—实验过程心得
hands-on-data-analysis 第三单元 模型搭建和评估
Correlation analysis related knowledge
[proteus simulation] Arduino uno key start / stop + PWM speed control DC motor speed
"Scoi2016" delicious problem solution
使用 Performance 看看浏览器在做什么
ThreadLocal giant pit! Memory leaks are just Pediatrics
33. Use rgbd camera for target detection and depth information output
Taishan Office Technology Lecture: four cases of using bold font
Assert and constd13
The most critical elements of team management
How to check if a text field is empty or not in swift
Knowledge about adsorption
Insect operator overloaded a fun
Niuke challenge 48 e speed instant forwarding (tree over tree)