Linking external static *.a libs (EB Assist ADTF) to ROS

asked 2015-11-19 03:31:20 -0500

Void_Int gravatar image

Hallo,

I want to link libs of EB Assist ADTF to a ROS-Node, but now I'm stuck.

Questions:

First, Is there a difference between linking *.so (dynamic) libs or *.a (static libs)?

In the following I copied the CMakeLists. It's based on the talker/listener example provided by ROS. I added a ADTF_DIR var in order to get the find_package(ADTF) command to be successful.

cmake_minimum_required(VERSION 2.8.3)
project(mytalker)

cmake_policy(SET CMP0002 NEW)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0011 NEW)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  message_generation
  genmsg
)
message("ADTF_LIBS_pre__" ${ADTF_LIBS})

set(ENV{ADTF_DIR} /home/marco/adtf)
find_package(ADTF REQUIRED)

message("ADTF_LIBS_post__" ${ADTF_LIBS})

#set(ADTF_ENABLE_GFX false)

## Generate messages in the 'msg' folder
add_message_files(DIRECTORY msg FILES Num.msg)
add_service_files(DIRECTORY srv FILES AddTwoInts.srv)

## Generate added messages and services with any dependencies listed here
generate_messages(DEPENDENCIES std_msgs)

include_directories(include ${catkin_INCLUDE_DIRS}
${ADTF_DIR}/include/additional/
${ADTF_DIR}/include/)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES mytalker
  CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
  DEPENDS system_lib ADTF
)

 ##Talker  
 message("Show_me_ADTF_LIBS" ${ADTF_LIBS}) 
 add_executable(talker src/talker.cpp) 
 target_link_libraries(talker
    ${catkin_LIBRARIES}
    ${ADTF_LIBS}
  )
  add_dependencies(talker mytalker_generate_messages_cpp )

If I run this in QtCreator I get the following Error:

make[2]: * No rule to make target 'adtfgfx-NOTFOUND', needed by 'devel/lib/mytalker/talker'. Stop.

make[1]: * [mytalker/CMakeFiles/talker.dir/all] Error 2

make: * [all] Error 2

The process "/usr/bin/make" exited with code 2.

Can you tell me what does this say ?

Alternative, I tried to link the libs in a different way. It doesnt give me an Error but I dont have any "ADTF" functionality in my source Files

##Talker
message("Show_me_ADTF_LIBS" ${ADTF_LIBS})
add_executable(talker src/talker.cpp)
target_link_libraries(talker
        ${catkin_LIBRARIES}
        ${ADTF_DIR}/lib/libadtfcomm_140.a
        ${ADTF_DIR}/lib/libadtfcommd_140.a
        ${ADTF_DIR}/lib/libadtfgfx_2130.a
        ${ADTF_DIR}/lib/libadtfgfxd_2130.a
        ${ADTF_DIR}/lib/libadtfsdk_2130.a
        ${ADTF_DIR}/lib/libadtfsdkd_2130.a
        ${ADTF_DIR}/lib/libadtfucom_190.a
        ${ADTF_DIR}/lib/libadtfucomd_190.a
        ${ADTF_DIR}/lib/libadtfutil_1160.a
        ${ADTF_DIR}/lib/libadtfutild_1160.a
        )
add_dependencies(talker mytalker_generate_messages_cpp )

Hopefully, you will be able can help me.

edit retag flag offensive close merge delete

Comments

were you able to find an answer for your inquiry, because I am kind of stuck in a similar situation and any help would be appreciated!

slmat27 gravatar image slmat27  ( 2019-01-04 05:28:19 -0500 )edit