gpt4 book ai didi

opencv - ROS Roboearth Ubuntu 12.04 vision_opencv 链接错误

转载 作者:太空宇宙 更新时间:2023-11-03 21:14:16 26 4
gpt4 key购买 nike

我试过问this question ROS 上的答案没有运气,所以我要在这里尝试。

我正在尝试编译 ROS Roboearth package并且似乎存在一些与 vision_opencv 的链接错误。

当我第一次尝试通过提供的说明进行编译时,我无法进行构建,因为我有旧的编译器而且我没有 Fuerte。所以,我将我的 Ubuntu 升级到 12.04 并更新到 ROS Fuerte。

然后我意识到 12.04 没有所需的 ros-fuerte-vision-opencv2 依赖项。因此,我从源代码编译并构建了 OpenCV 2.4.3,一切顺利。然后我意识到我也无法拉出我再次从 here 获得的 ros-fuerte-vision-opencv ,检查了“fuerte”分支并在/opt/ros/fuerte/stacks/vision_opencv中编译。

现在,当我尝试通过

制作 roboearth 时

rosmake roboearth

我收到以下链接错误。

感谢您的帮助。这可能只是我对 C++ 知识的缺乏,但我尝试了从检查依赖关系到重新设置编译器标志和依赖关系的顺序的所有方法,但我似乎无法让它工作。

[rosmake-1] Starting >>> ar_pose [ make ]                                                                                            
[ rosmake ] Last 40 lines_vision: 30.7 sec ] [ ar_pose: 4.2 sec ] [ 2 Active 47/103 Complete ]
{-------------------------------------------------------------------------------
make[3]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
[ 70%] Built target rosbuild_precompile
make[3]: Entering directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[3]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[3]: Entering directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
Linking CXX executable ../bin/ar_multi
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `ar_pose::ARSinglePublisher::arInit()':
/home/sasha/ros/stacks/ccny_vision/ar_pose/src/ar_multi.cpp:140: undefined reference to `cvCreateImage'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `CvBridge':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:67: undefined reference to `cvCreateImageHeader'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `~CvBridge':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:73: undefined reference to `cvReleaseImageHeader'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:78: undefined reference to `cvReleaseImage'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::reallocIfNeeded_(_IplImage**, CvSize, int, int)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:91: undefined reference to `cvReleaseImage'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:97: undefined reference to `cvCreateImage'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::reallocIfNeeded(_IplImage**, int, int)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:109: undefined reference to `cvGetSize'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::fromImage(sensor_msgs::Image_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:199: undefined reference to `cvInitMatHeader'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:200: undefined reference to `cvGetImage'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:229: undefined reference to `cvCreateMat'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:230: undefined reference to `cvConvertScale'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:236: undefined reference to `cvConvertScale'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:243: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:245: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:247: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:249: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:253: undefined reference to `cvCvtColor'
CMakeFiles/ar_multi.dir/src/ar_multi.o:/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:255: more undefined references to `cvCvtColor' follow
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::fromImage(sensor_msgs::Image_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:293: undefined reference to `cvReleaseMat'
collect2: ld returned 1 exit status
make[3]: *** [../bin/ar_multi] Error 1
make[3]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[2]: *** [CMakeFiles/ar_multi.dir/all] Error 2
make[2]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package ar_pose written to:
[ rosmake ] /home/sasha/.ros/rosmake/rosmake_output-20130212-145046/ar_pose/build_output.log
[rosmake-1] Finished <<< ar_pose [FAIL] [ 4.31 seconds ]
[ rosmake ] Halting due to failure in package ar_pose.
[ rosmake ] Waiting for other threads to complete.
[ rosmake ] Last 40 lines_vision: 182.3 sec ] [ 1 Active 47/103 Complete ]
{-------------------------------------------------------------------------------
../lib/libObjectDetectorFunctions.so: undefined reference to `cvReleaseMat'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::reshape(int, int, int const*) const'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvSetZero'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::warpPerspective(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Size_<int>, int, int, cv::Scalar_<double> const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::getTextSize(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double, int, int*)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::zeros(int, int, int)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::_InputArray::_InputArray(cv::MatExpr const&)'
../lib/libDVision.so: undefined reference to `cv::read(cv::FileNode const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::FlannBasedMatcher::train()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvCvtColor'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::MatConstIterator::seek(int const*, bool)'
../lib/libDVision.so: undefined reference to `cv::FeatureDetector::~FeatureDetector()'
../lib/libDUtilsCV.so: undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
../lib/libDVision.so: undefined reference to `cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::initUndistortRectifyMap(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::Size_<int>, int, cv::_OutputArray const&, cv::_OutputArray const&)'
../lib/libDVision.so: undefined reference to `cv::WriteStructContext::~WriteStructContext()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::copySize(cv::Mat const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvCreateImageHeader'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::inv(int) const'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Range const&, cv::Range const&)'
../lib/libDVision.so: undefined reference to `cv::operator<<(cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::flann::IndexParams::~IndexParams()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvGetSize'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::deallocate()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::_InputArray::_InputArray(double const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvCreateImage'
../lib/libDUtilsCV.so: undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Algorithm::~Algorithm()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::FlannBasedMatcher::FlannBasedMatcher(cv::Ptr<cv::flann::IndexParams> const&, cv::Ptr<cv::flann::SearchParams> const&)'
../lib/libDVision.so: undefined reference to `cv::Algorithm::set(char const*, bool)'
collect2: ld returned 1 exit status
make[3]: *** [../bin/ObjectDetector] Error 1
make[3]: Leaving directory `/home/sasha/ros/stacks/roboearth/re_vision/build'
make[2]: *** [CMakeFiles/ObjectDetector.dir/all] Error 2
make[2]: Leaving directory `/home/sasha/ros/stacks/roboearth/re_vision/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sasha/ros/stacks/roboearth/re_vision/build'
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package re_vision written to:
[ rosmake ] /home/sasha/.ros/rosmake/rosmake_output-20130212-145046/re_vision/build_output.log
[rosmake-0] Finished <<< re_vision [FAIL] [ 182.31 seconds ]
[ rosmake ] Halting due to failure in package re_vision.

最佳答案

好的,所以我能够解决问题。

首先我执行了 sudo apt-get update 并且我看到我收到以下消息:

W:重复的 sources.list 条目 http://archive.canonical.com/ubuntu/precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages)

为了解决这个问题,我转到“Synaptic Package Manager-> Settings -> Repositories -> Other Software”并取消选中“Canonical Partners - Added by software center”。

然后再次执行sudo apt-get update。这解决了上述问题。

然后,我转到以下文件/etc/apt/sources.list.d/ros-latest.list,看到url被注释掉了。我取消注释以下行 deb http://packages.ros.org/ros/ubuntu precise main 并再次运行 sudo apt-get update

在这一点之后,我能够通过 apt-get 安装 roboearth 所需的所有依赖项,并且能够使用 rosmake roboearth

成功制作 roboearth

关于opencv - ROS Roboearth Ubuntu 12.04 vision_opencv 链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14841689/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com