手动编译 mrpt 后,构建 mrpt 文件时遇到问题
After I compile mrpt manually, I have a trouble with build mrpt files
我正在尝试将每个系统与 ros
结合,但在此之前我想检查它是否正常工作,所以我 运行 在 CLion
上提交文件,我得到了这些错误。
/home/ian/Downloads/clion-2017.2.1/bin/cmake/bin/cmake --build /home/ian/CLionProjects/mrqt --target mrpt -- -j 4
[ 50%] Linking CXX executable mrpt
/usr/bin/ld: warning: libopencv_imgcodecs3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_core3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libmrpt-base.so: undefined reference to `cvLoadImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvConvertImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvReleaseImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSplit'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMatchTemplate'
/usr/local/lib/libmrpt-base.so: undefined reference to `_IplImage::_IplImage(cv::Mat const&)'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCreateImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSmooth'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvFlip'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvGetSize'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCvtColor'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCircle'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvGetQuadrangleSubPix'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvRemap'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvLine'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSaveImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCopy'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCloneImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSetImageROI'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvEqualizeHist'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMinMaxLoc'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMerge'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvResize'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvUndistort2'
collect2: error: ld returned 1 exit status
CMakeFiles/mrpt.dir/build.make:94: recipe for target 'mrpt' failed
make[3]: *** [mrpt] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mrpt.dir/all' failed
make[2]: *** [CMakeFiles/mrpt.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/mrpt.dir/rule' failed
make[1]: *** [CMakeFiles/mrpt.dir/rule] Error 2
Makefile:118: recipe for target 'mrpt' failed
make: *** [mrpt] Error 2
刚开始编译的时候还好,后来发现mrpt
头文件有问题,全部删掉手动编译,就出现了这个问题。我能得到一些建议吗?
您的系统中可能安装了不同版本的 MRPT。
我不建议 sudo make install
除非您有充分的理由这样做;仅在其自己的构建目录中编译项目将生成一个 MRPTConfig.cmake
文件,该文件允许 CMake 从 ROS 或任何其他用户项目中找到 MRPT。
如果 CMake 没有自动找到它,只需设置环境变量 export MRPT_DIR=/home/xxx/path/to/mrpt/build
即可。
您现在的问题是清理 /usr/local/
下可能存在的所有混乱。查看该目录,如果您 make install
编辑的唯一项目是 MRPT,我强烈建议使用 sudo rm -fr /usr/local/*
删除它。
如果您在那里有其他项目...那么...您必须从 MRPT 构建目录中 运行 sudo make uninstall
,然后手动确保没有剩余文件。
针对 OpenCV 的 link 错误看起来也像是 CMake 为一个 opencv 版本配置了项目,然后安装了另一个版本(可能是通过 ROS 包?)。
完成上面提到的 /usr/local
清理后,删除您当前的 MRPT CMake 构建目录并重新开始。
我正在尝试将每个系统与 ros
结合,但在此之前我想检查它是否正常工作,所以我 运行 在 CLion
上提交文件,我得到了这些错误。
/home/ian/Downloads/clion-2017.2.1/bin/cmake/bin/cmake --build /home/ian/CLionProjects/mrqt --target mrpt -- -j 4
[ 50%] Linking CXX executable mrpt
/usr/bin/ld: warning: libopencv_imgcodecs3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_core3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libmrpt-base.so: undefined reference to `cvLoadImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvConvertImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvReleaseImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSplit'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMatchTemplate'
/usr/local/lib/libmrpt-base.so: undefined reference to `_IplImage::_IplImage(cv::Mat const&)'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCreateImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSmooth'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvFlip'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvGetSize'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCvtColor'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCircle'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvGetQuadrangleSubPix'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvRemap'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvLine'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSaveImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCopy'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCloneImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSetImageROI'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvEqualizeHist'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMinMaxLoc'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMerge'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvResize'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvUndistort2'
collect2: error: ld returned 1 exit status
CMakeFiles/mrpt.dir/build.make:94: recipe for target 'mrpt' failed
make[3]: *** [mrpt] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mrpt.dir/all' failed
make[2]: *** [CMakeFiles/mrpt.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/mrpt.dir/rule' failed
make[1]: *** [CMakeFiles/mrpt.dir/rule] Error 2
Makefile:118: recipe for target 'mrpt' failed
make: *** [mrpt] Error 2
刚开始编译的时候还好,后来发现mrpt
头文件有问题,全部删掉手动编译,就出现了这个问题。我能得到一些建议吗?
您的系统中可能安装了不同版本的 MRPT。
我不建议 sudo make install
除非您有充分的理由这样做;仅在其自己的构建目录中编译项目将生成一个 MRPTConfig.cmake
文件,该文件允许 CMake 从 ROS 或任何其他用户项目中找到 MRPT。
如果 CMake 没有自动找到它,只需设置环境变量 export MRPT_DIR=/home/xxx/path/to/mrpt/build
即可。
您现在的问题是清理 /usr/local/
下可能存在的所有混乱。查看该目录,如果您 make install
编辑的唯一项目是 MRPT,我强烈建议使用 sudo rm -fr /usr/local/*
删除它。
如果您在那里有其他项目...那么...您必须从 MRPT 构建目录中 运行 sudo make uninstall
,然后手动确保没有剩余文件。
针对 OpenCV 的 link 错误看起来也像是 CMake 为一个 opencv 版本配置了项目,然后安装了另一个版本(可能是通过 ROS 包?)。
完成上面提到的 /usr/local
清理后,删除您当前的 MRPT CMake 构建目录并重新开始。