Hello,
I compiled my code using catkin_make, and some linking errors popped up. There are no problem with the compiling this time, just the linking. Here are half of my linking error log:
Scanning dependencies of target subscribe_to_pose
[ 50%] Built target pubvel
[100%] Building CXX object tj_ev3_drive/CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o
Linking CXX executable /home/robot/devel/lib/tj_ev3_drive/subscribe_to_pose
CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In function control::control()': subscribe_to_pose.cpp:(.text+0x30): undefined reference toev3dev::large_motor::large_motor(std::string)'
subscribe_to_pose.cpp:(.text+0x64): undefined reference to ev3dev::large_motor::large_motor(std::string)' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In functionev3dev::motor::set_command(std::string)':
subscribe_to_pose.cpp:(.text._ZN6ev3dev5motor11set_commandESs[_ZN6ev3dev5motor11set_commandESs]+0x4c): undefined reference to ev3dev::device::set_attr_string(std::string const&, std::string const&)' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In functionev3dev::motor::set_duty_cycle_sp(int)':
subscribe_to_pose.cpp:(.text._ZN6ev3dev5motor17set_duty_cycle_spEi[_ZN6ev3dev5motor17set_duty_cycle_spEi]+0x4c): undefined reference to ev3dev::device::set_attr_int(std::string const&, int)' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In functionev3dev::motor::state() const':
subscribe_to_pose.cpp:(.text._ZNK6ev3dev5motor5stateEv[_ZNK6ev3dev5motor5stateEv]+0x54): undefined reference to ev3dev::device::get_attr_set(std::string const&, std::string*) const' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In functionev3dev::motor::set_time_sp(int)':
subscribe_to_pose.cpp:(.text._ZN6ev3dev5motor11set_time_spEi[_ZN6ev3dev5motor11set_time_spEi]+0x4c): undefined reference to `ev3dev::device::set_attr_int(std::string const&, int)'
Hello, I compiled my code using catkin_make, and some linking errors popped up. There are no problem with the compiling this time, just the linking. Here are half of my linking error log:
Scanning dependencies of target subscribe_to_pose [ 50%] Built target pubvel [100%] Building CXX object tj_ev3_drive/CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o Linking CXX executable /home/robot/devel/lib/tj_ev3_drive/subscribe_to_pose CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In function
control::control()': subscribe_to_pose.cpp:(.text+0x30): undefined reference to
ev3dev::large_motor::large_motor(std::string)' subscribe_to_pose.cpp:(.text+0x64): undefined reference toev3dev::large_motor::large_motor(std::string)' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In function
ev3dev::motor::set_command(std::string)': subscribe_to_pose.cpp:(.text._ZN6ev3dev5motor11set_commandESs[_ZN6ev3dev5motor11set_commandESs]+0x4c): undefined reference toev3dev::device::set_attr_string(std::string const&, std::string const&)' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In function
ev3dev::motor::set_duty_cycle_sp(int)': subscribe_to_pose.cpp:(.text._ZN6ev3dev5motor17set_duty_cycle_spEi[_ZN6ev3dev5motor17set_duty_cycle_spEi]+0x4c): undefined reference toev3dev::device::set_attr_int(std::string const&, int)' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In function
ev3dev::motor::state() const': subscribe_to_pose.cpp:(.text._ZNK6ev3dev5motor5stateEv[_ZNK6ev3dev5motor5stateEv]+0x54): undefined reference toev3dev::device::get_attr_set(std::string const&, std::string*) const' CMakeFiles/subscribe_to_pose.dir/src/subscribe_to_pose.cpp.o: In function
ev3dev::motor::set_time_sp(int)': subscribe_to_pose.cpp:(.text._ZN6ev3dev5motor11set_time_spEi[_ZN6ev3dev5motor11set_time_spEi]+0x4c): undefined reference to `ev3dev::device::set_attr_int(std::string const&, int)'Where should I debug next? Thanks.