0
$\begingroup$

Rosanswers logo

Hello,

I struggle to compile the phidgets-ros-pkg:

I updated to Ubuntu 11.10 and have now ros electric (fresh install). I downloaded the phidgets-ros-pkg from https://launchpad.net/phidgets-ros-pkg and also installed the newest Phidget21 drivers for linux from http://www.phidgets.com/drivers.php. Now whenever I try $ rosmake phidgets I get this:

[ rosmake ] Last 40 linesidgets: 3.9 sec ]                                                                            [ 1 Active 62/63 Complete ]
{-------------------------------------------------------------------------------
  make[3]: Betrete Verzeichnis '/home/robot-head/ros/phidgets/build'
  make[3]: Verlasse Verzeichnis '/home/robot-head/ros/phidgets/build'
  [ 65%] Built target rosbuild_precompile
  make[3]: Betrete Verzeichnis '/home/robot-head/ros/phidgets/build'
  make[3]: Verlasse Verzeichnis '/home/robot-head/ros/phidgets/build'
  make[3]: Betrete Verzeichnis '/home/robot-head/ros/phidgets/build'
  Linking CXX executable ../bin/accelerometer
  CMakeFiles/accelerometer.dir/src/accelerometer.o: In function `DetachHandler(_CPhidget*, void*)':
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:72: undefined reference to `CPhidget_getDeviceName'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:73: undefined reference to `CPhidget_getSerialNumber'
  CMakeFiles/accelerometer.dir/src/accelerometer.o: In function `AttachHandler(_CPhidget*, void*)':
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:60: undefined reference to `CPhidget_getDeviceName'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:61: undefined reference to `CPhidget_getSerialNumber'
  CMakeFiles/accelerometer.dir/src/accelerometer.o: In function `attach(_CPhidgetAccelerometer*&, int, double)':
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:152: undefined reference to `CPhidgetAccelerometer_create'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:155: undefined reference to `CPhidget_set_OnAttach_Handler'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:156: undefined reference to `CPhidget_set_OnDetach_Handler'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:157: undefined reference to `CPhidget_set_OnError_Handler'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:162: undefined reference to `CPhidgetAccelerometer_set_OnAccelerationChange_Handler'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:165: undefined reference to `CPhidget_open'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:175: undefined reference to `CPhidget_waitForAttachment'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:178: undefined reference to `CPhidget_getErrorDescription'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:185: undefined reference to `CPhidgetAccelerometer_getAxisCount'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:189: undefined reference to `CPhidgetAccelerometer_setAccelerationChangeTrigger'
  CMakeFiles/accelerometer.dir/src/accelerometer.o: In function `disconnect(_CPhidgetAccelerometer*&)':
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:202: undefined reference to `CPhidget_close'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:203: undefined reference to `CPhidget_delete'
  CMakeFiles/accelerometer.dir/src/accelerometer.o: In function `display_properties(_CPhidgetAccelerometer*)':
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:121: undefined reference to `CPhidget_getDeviceType'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:122: undefined reference to `CPhidget_getSerialNumber'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:123: undefined reference to `CPhidget_getDeviceVersion'
  /home/robot-head/ros/phidgets/src/accelerometer.cpp:125: undefined reference to `CPhidgetAccelerometer_getAxisCount'
  collect2: ld gab 1 als Ende-Status zurück
  make[3]: *** [../bin/accelerometer] Fehler 1
  make[3]: Verlasse Verzeichnis '/home/robot-head/ros/phidgets/build'
  make[2]: *** [CMakeFiles/accelerometer.dir/all] Fehler 2
  make[2]: Verlasse Verzeichnis '/home/robot-head/ros/phidgets/build'
  make[1]: *** [all] Fehler 2
  make[1]: Verlasse Verzeichnis '/home/robot-head/ros/phidgets/build'
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package phidgets written to:
[ rosmake ]    /home/robot-head/.ros/rosmake/rosmake_output-20120306-160024/phidgets/build_output.log
[rosmake-0] Finished <<< phidgets [FAIL] [ 3.93 seconds ]                                                                                        
[ rosmake ] Halting due to failure in package phidgets. 
[ rosmake ] Waiting for other threads to complete.                                      
[ rosmake ] Results:                                                                                                                             
[ rosmake ] Built 63 packages with 1 failures.                                                                                                   
[ rosmake ] Summary output to directory                                                                                                          
[ rosmake ] /home/robot-head/.ros/rosmake/rosmake_output-20120306-160024

I also tried it with $ rosmake phidgets --pre-clean, but no success.

Can anyone help me with this issue? (I couldn't find anything online concerning rosmake phidgets and undefined references)


Originally posted by anbaldinger on ROS Answers with karma: 11 on 2012-03-06

Post score: 0


Original comments

Comment by anbaldinger on 2012-03-06:
Problem solved. Of course it had to do with the shared library phidget21. The solution was to edit CMakeLists.txt: Exclude (comment) all parts of the phidgets-ros-pkg from compilation i didn't need and add 'target_link_libraries(advanced_servo phidget21)' (i needed only advanced_servo. Worked!

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

From @anbaldinger Problem solved. Of course it had to do with the shared library phidget21. The solution was to edit CMakeLists.txt: Exclude (comment) all parts of the phidgets-ros-pkg from compilation i didn't need and add 'target_link_libraries(advanced_servo phidget21)' (i needed only advanced_servo. Worked!


Originally posted by tfoote with karma: 58457 on 2012-03-29

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.