Issue Linking Labjack libraries to ROS

asked 2019-08-30 05:57:04 -0500

Yogy Pratama gravatar image

Hii bro, i just start learning ROS so im totally dont know how to add libraries to ros .i have Labjack T-7 and i'm trying to integrated it into a ROS project. i have been working on but its still didn't fix the problem . i believe my problem its just link to the libraries. The Error i get it is :

testlabjack.cpp:(.text+0x170): undefined reference to `LJM_GetHandleInfo'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `PrintDeviceInfoFromHandle(int)':
testlabjack.cpp:(.text+0x1e5): undefined reference to `LJM_GetHandleInfo'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `PrintDeviceInfo(int, int, int, int, int, int)':
testlabjack.cpp:(.text+0x2d7): undefined reference to `LJM_NumberToIP'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `OpenOrDie(int, int, char const*)':
testlabjack.cpp:(.text+0x39b): undefined reference to `LJM_Open'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `OpenSOrDie(char const*, char const*, char const*)':
testlabjack.cpp:(.text+0x413): undefined reference to `LJM_OpenS'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `CloseOrDie(int)':
testlabjack.cpp:(.text+0x467): undefined reference to `LJM_Close'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `_ErrorCheckWithAddress(int, int, ErrorAction, char const*, __va_list_tag*)':
testlabjack.cpp:(.text+0x515): undefined reference to `LJM_ErrorToString'
testlabjack.cpp:(.text+0x58a): undefined reference to `LJM_ErrorToString'
testlabjack.cpp:(.text+0x5f3): undefined reference to `LJM_CloseAll'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `GetAndPrint(int, char const*)':
testlabjack.cpp:(.text+0x9d8): undefined reference to `LJM_eReadName'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `GetAndPrintIPAddress(int, char const*)':
testlabjack.cpp:(.text+0xa65): undefined reference to `LJM_eReadName'
testlabjack.cpp:(.text+0xa88): undefined reference to `LJM_NumberToIP'
CMakeFiles/testlabjack.dir/src/testlabjack.cpp.o: In function `GetAndPrintMACAddressFromValueAddress(int, char const*, int)':
testlabjack.cpp:(.text+0xb73): undefined reference to `LJM_eAddresses'

and my CMakeList.txt is :

cmake_minimum_required(VERSION 2.8.3)
project(roslabjack)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend tag for "message_generation"
##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every ...
(more)
edit retag flag offensive close merge delete