I am trying to connect a thermal-camera (Tau2, flir) to an iMX8-M+ Board with an Yocto-Image on it.
The error occurs in the make
command for the libthermalgrabber.
The error does NOT occur, when i make
the grabber within my docker-container in VSCode on windows.
Error:
aarch64-poky-linux/bin/ld: cannot find -lusb-1.0
collect2: error: ld returned 1 exit status
Some outputs I tried to determine whether libusb was actually installed (I tried 1.0.26 as well, but in the working container is 1.0.23 installed, that is why I chose that version):
root@ucm-imx8m-plus:~/tau_stuff/libthermalgrabber# apt-cache policy libusb-1.0*
libusb-1.0-0-dev:
Installed: 2:1.0.23-2build1
Candidate: 2:1.0.23-2build1
Version table:
*** 2:1.0.23-2build1 100
100 /var/lib/dpkg/status
libusb-1.0-doc:
Installed: 2:1.0.23-2build1
Candidate: 2:1.0.23-2build1
Version table:
*** 2:1.0.23-2build1 100
100 /var/lib/dpkg/status
libusb-1.0-0:
Installed: 2:1.0.23-2build1
Candidate: 2:1.0.23-2build1
Version table:
*** 2:1.0.23-2build1 100
100 /var/lib/dpkg/status
root@ucm-imx8m-plus:~/tau_stuff/libthermalgrabber# dpkg -l | grep libusb
ii libusb-1.0-0:arm64 2:1.0.23-2build1 arm64 userspace USB programming library
ii libusb-1.0-0-dev:arm64 2:1.0.23-2build1 arm64 userspace USB programming library development files
ii libusb-1.0-doc 2:1.0.23-2build1 all documentation for userspace USB programming
root@ucm-imx8m-plus:/usr/include/libusb-1.0# ls /usr/include/libusb-1.0/libusb.h
/usr/include/libusb-1.0/libusb.h
root@ucm-imx8m-plus:/usr/include/libusb-1.0# dpkg -L libusb-1.0-0-dev
/.
/usr
/usr/include
/usr/include/libusb-1.0
/usr/include/libusb-1.0/libusb.h
/usr/lib
/usr/lib/aarch64-linux-gnu
/usr/lib/aarch64-linux-gnu/libusb-1.0.a
/usr/lib/aarch64-linux-gnu/pkgconfig
/usr/lib/aarch64-linux-gnu/pkgconfig/libusb-1.0.pc
/usr/share
/usr/share/doc
/usr/share/doc/libusb-1.0-0-dev
/usr/share/doc/libusb-1.0-0-dev/copyright
/usr/lib/aarch64-linux-gnu/libusb-1.0.so
/usr/share/doc/libusb-1.0-0-dev/README
/usr/share/doc/libusb-1.0-0-dev/changelog.Debian.gz
root@ucm-imx8m-plus:/usr/include/libusb-1.0# dpkg -L libusb-1.0-0
/.
/lib
/lib/aarch64-linux-gnu
/lib/aarch64-linux-gnu/libusb-1.0.so.0.2.0
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libusb-1.0-0
/usr/share/doc/libusb-1.0-0/README
/usr/share/doc/libusb-1.0-0/changelog.Debian.gz
/usr/share/doc/libusb-1.0-0/copyright
/lib/aarch64-linux-gnu/libusb-1.0.so.0
root@ucm-imx8m-plus:/usr/include/libusb-1.0#
root@ucm-imx8m-plus:/usr/include/libusb-1.0# dpkg-query -S /usr/lib/aarch64-linux-gnu/
libusb-1.0-0-dev:arm64: /usr/lib/aarch64-linux-gnu
The library that is being searched is within the CMakeLists.txt of the project at
link_libraries (usb-1.0)
The camera itself is recognized as.. (It is NOT recognized as a camera, that is normal. It has a RS232 to USB Adapter attached)
root@ucm-imx8m-plus:~/tau_stuff/libthermalgrabber# lsusb
Bus 003 Device 001: ID 1d6b:0002
Bus 001 Device 001: ID 1d6b:0002
Bus 004 Device 001: ID 1d6b:0003
Bus 002 Device 001: ID 1d6b:0003
--> Bus 003 Device 004: ID 0403:6010 <--
I'll attach the CMakeLists.txt here, maybe that has any clues in it:
set( CMAKE_BUILD_TYPE RelWithDebInfo )
set( CMAKE_CXX_FLAGS "-std=c++11" )
#set( CMAKE_CXX_FLAGS "-fpermissive -std=c++11" )
set( CMAKE_VERBOSE_MAKEFILE on )
set( TARGET thermalgrabber )
set( ROOT ./ )
set( LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib )
set( TEAXLIB_VERSION_MAJOR 1 )
set( TEAXLIB_VERSION_MINOR 2 )
set( TEAXLIB_VERSION_PATCH 0 )
set( TEAXLIB_VERSION_STRING ${TEAXLIB_VERSION_MAJOR}.${TEAXLIB_VERSION_MINOR}.${TEAXLIB_VERSION_PATCH} )
#set(USE_FTDI_LIB 1)
cmake_minimum_required(VERSION 2.8)
if (WIN32)
MESSAGE("Setup for windows")
if (USE_FTDI_LIB)
MESSAGE("Using ftdi lib")
ADD_DEFINITIONS(-DUSE_FTDI)
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}/src/inc
)
link_directories (
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/ftdi_i386
)
link_libraries (
ftd2xx
)
elseif (NOT USE_FTDI_LIB)
MESSAGE("Using libusb")
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}/src/inc
)
link_directories (
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/MingGW32/dll
)
link_libraries (
libusb-1.0
)
endif(USE_FTDI_LIB)
elseif (NOT WIN32)
MESSAGE("Setup for linux")
if (USE_FTDI_LIB)
MESSAGE("Not implemented")
elseif (NOT USE_FTDI_LIB)
MESSAGE("Using libusb")
include_directories (
/usr/include/libusb-1.0
/usr/local/include/libusb-1.0
)
link_directories (
/usr/lib/x86_64-linux-gnu
/usr/local/lib
)
link_libraries (
usb-1.0
)
endif (USE_FTDI_LIB)
endif(WIN32)
#unix:CONFIG(release, debug|release): LIBS += -L/usr/include/libusb-1.0 -libusb-1.0
set( SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/thermalgrabber.cpp
${CMAKE_CURRENT_SOURCE_DIR}/inc/thermalgrabber.h
${CMAKE_CURRENT_SOURCE_DIR}/src/thermograbber.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/thermograbber.h
${CMAKE_CURRENT_SOURCE_DIR}/src/tauinterface.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tauinterface.h
${CMAKE_CURRENT_SOURCE_DIR}/src/tauimagedecoder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tauimagedecoder.h
${CMAKE_CURRENT_SOURCE_DIR}/src/taucom.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/taucom.h
${CMAKE_CURRENT_SOURCE_DIR}/src/fastftdi.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/fastftdi.h
${CMAKE_CURRENT_SOURCE_DIR}/src/crc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/crc.h
)
include_directories (
${ROOT}
${THERMALGRABBER}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/inc # public header
${CMAKE_CURRENT_SOURCE_DIR}/src # internal headers
)
link_directories (
${CMAKE_CURRENT_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}/src/lib
#${CMAKE_CURRENT_SOURCE_DIR}/src/lib/ftdi_i386
)
add_library( ${TARGET} SHARED ${SOURCES} )
set_target_properties( ${TARGET} PROPERTIES VERSION ${TEAXLIB_VERSION_STRING} SOVERSION ${TEAXLIB_VERSION_MAJOR} )
install( TARGETS ${TARGET} DESTINATION ${CMAKE_SOURCE_DIR}/lib )
target_link_libraries(
${TARGET}
pthread
)
Any help is appreciated. The system does NOT have any access to the internet and is not supposed to, so installing via apt install libusb-dev
or alike is not viable. I installed those packages with .deb
files.