Dear Experts,
I tried to build my project.
I got below error.
/usr/bin/ld: cannot find -lnvbuf_utils
collect2: error: ld returned 1 exit status
CMakeFiles/visionFV0.dir/build.make:168: recipe for target ‘visionFV0’ failed
make[2]: *** [visionFV0] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/visionFV0.dir/all’ failed
make[1]: *** [CMakeFiles/visionFV0.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2
Hi,
Please check if below comment:
Thanks.
My jetpack version: 4.6.1-b110
I have added link_directories(/usr/lib/aarch64-linux-gnu/tegra). But I have got the same error.
Hi,
Could you check if the library is presented in your environment?
$ ll /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so*
lrwxrwxrwx 1 root root 23 Nov 22 2022 /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so -> libnvbuf_utils.so.1.0.0
-rw-r--r-- 1 root root 49240 Nov 22 2022 /usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so.1.0.0
Thanks.
I have checked the file. It is there in /usr/lib/aarch64-linux-gnu/tegra/
Thanks
Jaganathan
Hi @jaganathan.comm, can you paste your CMakeLists.txt here?
From your post history, are you trying to compile an application that uses jetson-inference/jetson-utils? Here is an example CMakeLists of doing that for an out-of-tree project:
Hi Dustin,
Here is my CMakeList.txt
cmake_minimum_required(VERSION 3.2)
#Project Name
project(testProject)
#Packages adding
#OpenCV Package
#Real Sense Package
#CUDA package
#JETSON UTILS
#JETSON INFERENCE
find_package(Threads REQUIRED)
find_package(OpenCV REQUIRED)
find_package(realsense2 REQUIRED)
find_package(CUDA REQUIRED)
find_package(jetson-utils REQUIRED)
find_package(jetson-inference REQUIRED)
set(DEPENDENCIES realsense2 ${OpenCV_LIBS})
set(visionF_VERSION 1.0.0)
add_definitions(-std=c++14)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
string(TIMESTAMP TODAY “%Y-%m-%d”)
message(STATUS: “Today Date is ${TODAY}”)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(/usr/lib/aarch64-linux-gnu/tegra)
link_directories(/usr/lib/aarch64-linux-gnu/)
cuda_add_executable(visionFV0 testMain.cpp )
#include_directories(/usr/include
target_link_libraries(visionFV0 ${OpenCV_LIBS} ${realsense2_LIBRARY} jetson-inference jetson-utils )
target_link_libraries(visionFV0 pthread)
@jaganathan.comm can you try changing this to link_directories(/usr/lib/aarch64-linux-gnu/tegra)
Yeah. It’s working now.
Thanks
The problem was…
Early i have added link_directories(/usr/lib/aarch64-linux-gnu/tegra) after cuda_add_executables(visionF0 testMain.cpp)
Because of that i got the error.
Gotcha, yes - CMake requires the link_directories to be added before the executables/libraries are added. Glad you got it working! 👍
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.