ORB_SLAM icon indicating copy to clipboard operation
ORB_SLAM copied to clipboard

But the last step has issues,

Open yanyan-li opened this issue 8 years ago • 7 comments

It's almost done. But the last step has issues now. Can somebody help? I have no ideas about it. Thanks.

[ 84%] Building CXX object CMakeFiles/ORB_SLAM.dir/src/KeyFrameDatabase.cc.o [ 89%] Building CXX object CMakeFiles/ORB_SLAM.dir/src/Sim3Solver.cc.o [ 94%] Building CXX object CMakeFiles/ORB_SLAM.dir/src/Initializer.cc.o [100%] Linking CXX executable ../bin/ORB_SLAM CMakeFiles/ORB_SLAM.dir/src/main.cc.o: In function main': main.cc:(.text.startup+0xbc8): undefined reference to ros::init(int&, char**, std::string const&, unsigned int)' main.cc:(.text.startup+0xccb): undefined reference to ros::package::getPath(std::string const&)' main.cc:(.text.startup+0xe5c): undefined reference to ros::package::getPath(std::string const&)' main.cc:(.text.startup+0x13b4): undefined reference to ros::package::getPath(std::string const&)' main.cc:(.text.startup+0x193b): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In function ORB_SLAM::Tracking::CreateInitialMap(cv::Mat&, cv::Mat&)': Tracking.cc:(.text+0x21e4): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' Tracking.cc:(.text+0x229f): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In function ORB_SLAM::Tracking::Run()': Tracking.cc:(.text+0x2946): undefined reference to ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In function ORB_SLAM::Tracking::GrabImage(boost::shared_ptr<sensor_msgs::Image_<std::allocator > const> const&)': Tracking.cc:(.text+0x4589): undefined reference to cv_bridge::toCvShare(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, std::string const&)' Tracking.cc:(.text+0x5e11): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o: In function ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)': Tracking.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x604): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/LoopClosing.cc.o: In function ORB_SLAM::LoopClosing::CorrectLoop()': LoopClosing.cc:(.text+0x2a47): undefined reference to ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' CMakeFiles/ORB_SLAM.dir/src/FramePublisher.cc.o: In function ORB_SLAM::FramePublisher::FramePublisher()': FramePublisher.cc:(.text+0x1c3a): undefined reference to ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&)' CMakeFiles/ORB_SLAM.dir/src/MapPublisher.cc.o: In function ORB_SLAM::MapPublisher::MapPublisher(ORB_SLAM::Map*)': MapPublisher.cc:(.text+0xb7e): undefined reference to ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::lessstd::string, std::allocator<std::pair<std::string const, std::string> > > const&)' collect2: error: ld returned 1 exit status CMakeFiles/ORB_SLAM.dir/build.make:1645: recipe for target '../bin/ORB_SLAM' failed make[2]: *** [../bin/ORB_SLAM] Error 1 CMakeFiles/Makefile2:324: recipe for target 'CMakeFiles/ORB_SLAM.dir/all' failed make[1]: *** [CMakeFiles/ORB_SLAM.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

my OS is Ubuntu16.04. Thanks a lot.

yanyan-li avatar Jun 19 '17 13:06 yanyan-li

Actually I got this too ! The last step for compiling ORB-SLAM on Ubuntu 16.04 installed. Any hints ? cheers !!


CMakeFiles/ORB_SLAM.dir/src/Tracking.cc.o:in function ‘ORB_SLAM::Tracking::GrabImage(boost::shared_ptr<sensor_msgs::Image_<std::allocator > const> const&)’中: Tracking.cc:(.text+0x494b):对‘cv_bridge::toCvShare(boost::shared_ptr<sensor_msgs::Image_<std::allocator > const> const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’undefined reference. CMakeFiles/ORB_SLAM.dir/src/FramePublisher.cc.o:in function ‘ORB_SLAM::FramePublisher::PublishFrame()’中: FramePublisher.cc:(.text+0x24e5):对‘cv_bridge::CvImage::toImageMsg() const’ undefined reference. collect2: error: ld returned 1 exit status CMakeFiles/ORB_SLAM.dir/build.make:1567: recipe for target '../bin/ORB_SLAM' failed make[2]: *** [../bin/ORB_SLAM] # Error 1 CMakeFiles/Makefile2:324: recipe for target 'CMakeFiles/ORB_SLAM.dir/all' failed make[1]: *** [CMakeFiles/ORB_SLAM.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2


wangzhaoguang avatar Jul 22 '17 15:07 wangzhaoguang

hello world, for the building problem I encountered, I got through via: see the attached pictures.

cheers. 2017-07-23 15-58-18 2017-07-23 16-00-18

wangzhaoguang avatar Jul 23 '17 08:07 wangzhaoguang

@wangzhaoguang Is there anything else you changed? I deleted Opencv2 as well and it still didn't work

jtbon20 avatar Aug 01 '17 01:08 jtbon20

No i did not change other parts.

wangzhaoguang avatar Sep 13 '17 15:09 wangzhaoguang

Check your gcc version. I met similar problem in ROS nodes building. Gcc 4.9 has linking problem, but gcc 5.4 works fine.

jinchenglee avatar Nov 08 '17 03:11 jinchenglee

refer to this, solve it for ROS catkin build on Ubuntu 16.04, thanks.

whyscience avatar Dec 28 '17 02:12 whyscience

Where shall we place the code? @wangzhaoguang Thanks!

Debbieliang9 avatar Apr 19 '21 03:04 Debbieliang9