ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

External Library Link Error [closed]

asked 2011-08-11 18:25:18 -0600

Dongjun gravatar image

updated 2011-09-02 11:47:26 -0600

kwc gravatar image

I'm trying to use external library file "".

I met following error message.

Linking CXX executable ../dssp

CMakeFiles/dssp.dir/src/dssp.o: In function `main':

/home/hass/my_robot/dssp/src/dssp.cpp:9: undefined reference to `dssp_rs232_drv_module_create(char const*, int)'

collect2: ld returned 1 exit status

My setup files are followings


cmake_minimum_required(VERSION 2.4.6)



rosbuild_add_executable(dssp src/dssp.cpp)

target_link_libraries(dssp dssp_rs232_drive_module)





  <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib -ldssp_rs232_drive_module"/>



How can I solve this problem?

PS. I tried to make execution file of microstrain_3dmgx2_imu Package, which is the officially published package in ROS DIAMONDBACK. sudo make clean sudo make But I met the same error massage. Why does the officially published package have the same link error?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by kwc
close date 2012-02-29 07:53:18


It seems that the library doesn't provide the call, which shouldn't be. What system are you using? To verify its linked, you can VERBOSE=1 make, to show compiler lines.
dornhege gravatar image dornhege  ( 2011-08-12 02:04:43 -0600 )edit
BTW: You don't need the export in the manifest. That is for other packages using libraries that you build.
dornhege gravatar image dornhege  ( 2011-08-12 02:06:17 -0600 )edit
you can try running "nm |grep dssp_rs232_drv_module_create" to see if that symbol is available in your library
Markus Achtelik gravatar image Markus Achtelik  ( 2011-09-02 12:05:33 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-08-13 05:21:31 -0600

Zack gravatar image

change the following line

from target_link_libraries(dssp dssp_rs232_drive_module)

to target_link_libraries(dssp /pathto/

where pathto is the path to ur file

edit flag offensive delete link more


Can you post your edited CMakeLists.txt? And perhaps you might want to consider posing your comments as comments
Zack gravatar image Zack  ( 2011-08-22 15:27:11 -0600 )edit

answered 2011-08-21 16:35:12 -0600

Dongjun gravatar image

The answer doesn't solve the problem. And, the error message is same to the previous one.

edit flag offensive delete link more

Question Tools


Asked: 2011-08-11 18:25:18 -0600

Seen: 522 times

Last updated: Sep 02 '11