You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_custom_target(
run
DEPENDS pro
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/workspace
COMMAND ./pro
)
error:
CMakeFiles/pro.dir/src/main.cpp.o: In function single_inference()': /infer/src/main.cpp:107: undefined reference to yolo::Infer::forward(yolo::Image const&, void*)'
collect2: error: ld returned 1 exit status
CMakeFiles/pro.dir/build.make:165: recipe for target '../workspace/pro' failed
I appreciate your guidance and valuable resources.
Sincerely,
yidasahe92905
The text was updated successfully, but these errors were encountered:
Dear shouxieai,
I encountered an issue while using your document and I'm seeking your assistance to resolve it. The details are as follows:
CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(pro)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/workspace)
set(CUDA_GEN_CODE "-gencode=arch=compute_72,code=sm_72")
set(OpenCV_DIR "/usr/local/include/opencv4/")
set(CUDA_DIR "/usr/local/cuda-10.2")
set(TENSORRT_INCLUDE_DIR "/usr/include/aarch64-linux-gnu")
set(TENSORRT_LIB_DIR "/usr/lib/aarch64-linux-gnu")
find_package(CUDA REQUIRED)
find_package(OpenCV)
include_directories(
${PROJECT_SOURCE_DIR}/src
${OpenCV_INCLUDE_DIRS}
${CUDA_DIR}
${TENSORRT_INCLUDE_DIR}
)
link_directories(
${TENSORRT_INCLUDE_DIR}/lib
${CUDA_DIR}/lib64
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -O0 -Wfatal-errors -pthread -w -g")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11 -O0 -Xcompiler -fPIC -g -w ${CUDA_GEN_CODE}")
file(GLOB_RECURSE cpp_srcs ${PROJECT_SOURCE_DIR}/src/.cpp)
file(GLOB_RECURSE cuda_srcs ${PROJECT_SOURCE_DIR}/src/.cu)
cuda_add_library(cucodes SHARED ${cuda_srcs})
add_executable(pro ${cpp_srcs})
target_link_libraries(cucodes nvinfer nvonnxparser)
target_link_libraries(cucodes cuda cublas cudart cudnn)
target_link_libraries(pro ${OpenCV_LIBS})
target_link_libraries(pro cucodes)
add_custom_target(
run
DEPENDS pro
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/workspace
COMMAND ./pro
)
error:
CMakeFiles/pro.dir/src/main.cpp.o: In function
single_inference()': /infer/src/main.cpp:107: undefined reference to
yolo::Infer::forward(yolo::Image const&, void*)'collect2: error: ld returned 1 exit status
CMakeFiles/pro.dir/build.make:165: recipe for target '../workspace/pro' failed
I appreciate your guidance and valuable resources.
Sincerely,
yidasahe92905
The text was updated successfully, but these errors were encountered: