ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

getting linkage error : X11

asked 2016-03-05 15:30:58 -0500

rnunziata gravatar image

updated 2016-03-05 15:33:53 -0500

Getting linkage error: XInitTreads unresolved in libsl_zed.so In the past I was able to simple put the X11 linkage in my CMakeList and that worked but now this seems to have stopped working. Any ideas what can be causing this issue. I should also mention that this is being compiled on the Jetson tk1 (arm7).

cmake_minimum_required(VERSION 2.8.7)

project(zed_wrapper)

###############################################################################
## Options
option( DEBUG_ACTIVE "Enable Debug build" ON )

if(DEBUG_ACTIVE)
    MESSAGE( "Debug compilation active" )
    set(ROS_BUILD_TYPE Debug)
    set(CMAKE_BUILD_TYPE Debug)
else()
    MESSAGE( "Release compilation active" )
    set(ROS_BUILD_TYPE Release)
    set(CMAKE_BUILD_TYPE Release)
endif()
###############################################################################

find_package(ZED 0.9 REQUIRED)
find_package(X11 REQUIRED)
find_package(CUDA REQUIRED)
find_package(OpenCV 2.4 COMPONENTS core highgui imgproc REQUIRED)
find_package(PCL REQUIRED)

find_package(catkin REQUIRED COMPONENTS
  image_transport
  roscpp
  rosconsole
  sensor_msgs
  cv_bridge
  dynamic_reconfigure
)

generate_dynamic_reconfigure_options(
  cfg/Zed.cfg
)

catkin_package(
  CATKIN_DEPENDS
    roscpp
    rosconsole
    sensor_msgs
    opencv2
    cv_bridge
    image_transport
    dynamic_reconfigure
)

###############################################################################
# INCLUDES

# Specify locations of header files.
include_directories(
    ${catkin_INCLUDE_DIRS} 
    ${CUDA_INCLUDE_DIRS}
    ${ZED_INCLUDE_DIRS}
    ${OpenCV_INCLUDE_DIRS}
    ${PCL_INCLUDE_DIRS}
)

link_directories(${X11_LIBRARY_DIR})
link_directories(${ZED_LIBRARY_DIR})
link_directories(${CUDA_LIBRARY_DIRS})
link_directories(${OpenCV_LIBRARY_DIRS})
link_directories(${PCL_LIBRARY_DIRS})

###############################################################################

###############################################################################
# EXECUTABLE

add_definitions(-std=c++11)# -m64) #-Wall)


add_executable(
  zed_wrapper_node
  src/zed_wrapper_node.cpp
)

target_link_libraries(
        zed_wrapper_node
        ${catkin_LIBRARIES}
        ${X11_LIBRARIES}
        ${ZED_LIBRARIES}
    ${CUDA_LIBRARIES} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY}
        ${OpenCV_LIBS}
        ${PCL_LIBRARIES}  
    )

add_dependencies(zed_wrapper_node ${PROJECT_NAME}_gencfg)
###############################################################################

#Add all files in subdirectories of the project in
# a dummy_target so qtcreator have access to all files
FILE(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
add_custom_target(dummy_${PROJECT_NAME} SOURCES ${extra_files})
Status API Training Shop Blog About Pricing
© 2016 GitHub, Inc. Terms Privacy Security Contact Help
edit retag flag offensive close merge delete

Comments

It looks like you're trying to compile this package: https://github.com/stereolabs/zed-ros... and you've opened a ticket there with more info: https://github.com/stereolabs/zed-ros...

ahendrix gravatar image ahendrix  ( 2016-03-05 16:57:20 -0500 )edit

It looks like your version of libsl_zed.so might have missing dependencies or might have become broken during a recent update. Is libsl_zed.so something that you installed and built from source? Have you upgraded your system recently?

ahendrix gravatar image ahendrix  ( 2016-03-05 16:59:59 -0500 )edit

I did a general update of the system before taking a new version of zed-ros-wrapper. Prior to that it compiled . Not sure if libsl_zed.so was updated at that time. I did open an issue on this on github and also send an email to zedlabs tech support. Have not heard back yet on either.

rnunziata gravatar image rnunziata  ( 2016-03-05 21:05:37 -0500 )edit

If libsl_zed.so had a missing dependency should not including the link library as I have done resolve the reference? I was wondering if there was a circular reference somewhere.

rnunziata gravatar image rnunziata  ( 2016-03-05 21:09:56 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2016-03-06 11:32:55 -0500

rnunziata gravatar image

Problem determined to be zedlab s issue with the Jetson TK1.

edit flag offensive delete link more

Comments

Please update your answer with a detailed description of your solution, so that the next person doesn't have the same trouble that you did.

ahendrix gravatar image ahendrix  ( 2016-03-06 15:20:14 -0500 )edit
0

answered 2016-03-05 21:46:15 -0500

ahendrix gravatar image

updated 2016-03-05 23:17:10 -0500

The ordering of link flags to the compiler is important. See https://stackoverflow.com/questions/4... for a reasonable explanation.

Try changing the order that your libraries are listed, so that ${ZED_LIBRARIES} is listed first, and ${X11_LIBRARIES} is listed after it.

UPDATE 1

Since changing the link order doesn't help, you should confirm that the XInitThreads symbol is actually present in your version of the X11 library. You can do this with nm: nm -D libX11.so | grep XInitThreads . The resulting symbol type should be T, indicating that the function is present in the "text" section of the library. (read the man page for nm for more details). On my desktop system, libX11.so is in /usr/lib/x86_64-linux-gnu , but since you're on the TK1 your copy of libX11.so will probably be somewhere different.

P.S. - Given that zedlabs is officially providing ROS drivers and an official SDK for the TK1, those should work together. Did you report your previous troubles to them, when you first found that you needed additional libraries when building on the TK1? EDIT: I'm disappointed that their official support is so lacking.

edit flag offensive delete link more

Comments

I did ... they suggested that I include X11 library which I did and it worked until this latest release of the wrapper. Other then that nothing else changed. I am now waiting on them for further insight and any I can get from this forum. I did try moving the X11 lib around in the linkage path.

rnunziata gravatar image rnunziata  ( 2016-03-05 22:36:32 -0500 )edit

So the reference is as you show and I made sure the correct lib is being picked up in cmakelist. At this point I think it is zedlab ...so I will close this. Thank you for your help.

rnunziata gravatar image rnunziata  ( 2016-03-06 11:32:19 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-03-05 15:30:58 -0500

Seen: 519 times

Last updated: Mar 06 '16