Comments (5)
你的cmakelist怎么写了?链到Eigen上去了吗?
from slambook2.
感谢高博的回复!
Eigen是只需要include_dir就行吧?我的CMakeLists.txt是这样写的:
cmake_minimum_required(VERSION 2.8)
project(imageBasics)
set(CMAKE_CXX_FLAGS "-std=c++11")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories("/usr/include/eigen3")
add_executable(imageBasics imageBasics.cpp)
target_link_libraries(imageBasics ${OpenCV_LIBS})
我运行从您的仓库中git clone过来的代码也是报同样的错误。
另外,安装依赖项的时候,libvtk5-dev提示无法安装,我装的是libvtk6-dev。所以一开始有很多类似报错都是/usr/bin/ld: 找不到 -ltk***。不知道是不是这个原因?我安装的OpenCV 版本是3.4.7
from slambook2.
你上面贴的错误和opencv应该没关系。这个cmakelist也会报eigen的链接错误吗?
from slambook2.
是的,用这个cmakelists也会报eigen的错误。然后我重新做了下ch3的useEigen,没有问题。
ch5的这个程序cmake时有一个warning,而且这个warning重复出了十多次,下面我只贴出了一段这样的waring。会不会是我的cmake的问题?
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /usr/local (found version "3.4.7")
-- Configuring done
CMake Warning (dev) at CMakeLists.txt:13 (add_executable):
Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
Target "imageBasics" links to target "Eigen3::Eigen" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
This warning is for project developers. Use -Wno-dev to suppress it.
【重复】
-- Generating done
-- Build files have been written to: /home/bene-robot/slambook2/ch5/imageBasics/build
from slambook2.
问题解决了!我改了cmakelist的写法,新的cmakelist如下:
cmake_minimum_required(VERSION 2.8)
project(imageBasics)
set(CMAKE_CXX_FLAGS "-std=c++11")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
find_package(Eigen3 REQUIRED)
include_directories( EIGEN3_INCLUDE_DIRS)
#include_directories("/usr/include/eigen3")
message(${EIGEN3_INCLUDE_DIRS})
add_executable(imageBasics imageBasics.cpp)
target_link_libraries(imageBasics ${OpenCV_LIBS})
就是把#include_directories("/usr/include/eigen3")
改成了
find_package(Eigen3 REQUIRED)
include_directories( EIGEN3_INCLUDE_DIRS)
是参考了这个链接https://stackoverflow.com/questions/12249140/find-package-eigen3-for-cmake
但是message输出的信息也是/usr/include/eigen3
,不知道为什么直接用#include_directories("/usr/include/eigen3")
就不行。
from slambook2.
Related Issues (20)
- ch3 plotTrajectory segmentation fault HOT 6
- ch3/X11 Error HOT 2
- 第九章,ch9中g2o优化里没有求雅可比的步骤是为什么呢? HOT 1
- 第7章,ch7 pose_estimation_2d2d.cpp求得的基础矩阵和本质矩阵E关系没有满足严格的推导公式的相等关系 HOT 1
- 对于手写高斯牛顿法的疑问 HOT 2
- ch7 pose_estimation_3d3d.cpp argument naming
- 编译sophus库时出现报错,没有查到解决办法
- ch4下的轨迹评估,只显示一条轨迹
- Where does the triangulation method come from in Chapter 13? HOT 1
- ch7 p178页关于三角化的矩阵T2的问题
- 关于ch8多层光流中一直沿用原始深度值的疑惑
- ch9 BA_g2o 用新库无法通过编译
- CMakeFiles/test_triangulation.dir/test_triangulation.cpp.o: In function `Sophus::SO3Base<Sophus::SO3<double, 0> >::normalize() [clone .part.1600]': test_triangulation.cpp:(.text.unlikely+0x141): undefined reference to `fmt::print(fmt::BasicCStringRef<char>, fmt::ArgList)' test_triangulation.cpp:(.text.unlikely+0x15a): undefined reference to `fmt::print(fmt::BasicCStringRef<char>, fmt::ArgList)' HOT 1
- 请问Ubuntu版本有没有要求 HOT 2
- 我是小白,请问为什么我把这里的代码拷贝到虚拟机里以后,3rdparty的各个子目录都是空的啊? HOT 5
- [ch12] 在单目稠密估计的示例代码中,关于坐标转化的疑问 HOT 1
- Two questions on ceres BA in CH9
- ch4 make Sophus库的时候报错 HOT 3
- ch3 visualizeGeometry.cpp Display Issue HOT 1
- ch8 optical_flow.cpp bias, jacobian calculate issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slambook2.