We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I compile "TensorRT-introduction", but have some error as follow:
CMakeFiles/main.dir/ioHelper.cpp.o: In function `nvinfer1::readTensorProto(std::string const&, float*)': ioHelper.cpp:(.text+0x131): undefined reference to `onnx::TensorProto::TensorProto()' ioHelper.cpp:(.text+0x232): undefined reference to `onnx::TensorProto::~TensorProto()' ioHelper.cpp:(.text+0x255): undefined reference to `onnx::TensorProto::~TensorProto()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/main.dir/build.make:201: main] Error 1 make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/main.dir/all] Error 2 make: *** [Makefile:103: all] Error 2
CMakeLists.txt
cmake_minimum_required(VERSION 2.8) project(simpleOnnx) add_executable(main simpleOnnx_2.cpp cudaWrapper.h ioHelper.cpp ioHelper.h logger.cpp) include_directories(/usr/local/include) include_directories(/home/developer/zhangcc/download/TensorRT-7.0.0.11/include) include_directories(/home/developer/zhangcc/download/TensorRT-7.0.0.11/samples/common) set(TENSORRT_DIR /home/developer/zhangcc/download/TensorRT-7.0.0.11/lib) find_package(CUDA 10.2 REQUIRED) message(STATUS "CUDA status:") message(STATUS " include path: ${CUDA_INCLUDE_DIRS}") message(STATUS " libraries: ${CUDA_LIBRARIES}") include_directories(${CUDA_INCLUDE_DIRS}) target_link_libraries(main ${CUDA_LIBRARIES}) find_package(Protobuf REQUIRED) message(STATUS "Protobuf library status:") message(STATUS " version: ${Protobuf_VERSION}") message(STATUS " libraries: ${Protobuf_LIBS}") message(STATUS " include path: ${Protobuf_INCLUDE_DIRS}") target_link_libraries(main /usr/local/lib/libprotobuf-lite.so) target_link_libraries(main /usr/local/lib/libonnxifi.so) target_link_libraries(main /usr/local/lib/libprotoc.so) target_link_libraries(main ${TENSORRT_DIR}/libnvinfer.so ${TENSORRT_DIR}/libnvinfer_plugin.so ${TENSORRT_DIR}/libnvonnxparser.so ${TENSORRT_DIR}/libnvparsers.so)
The text was updated successfully, but these errors were encountered:
@zccyman add target_link_libraries like as follow.
target_link_libraries(main /usr/local/lib/libprotobuf-lite.so) target_link_libraries(main /usr/local/lib/libprotoc.so) target_link_libraries(main /usr/local/lib/libonnx.a) target_link_libraries(main /usr/local/lib/libonnx_proto.a) target_link_libraries(main /usr/local/lib/libonnxifi_dummy.so) target_link_libraries(main /usr/local/lib/libonnxifi_loader.a) target_link_libraries(main /usr/local/lib/libonnxifi.so)
Sorry, something went wrong.
I successfully compile the project by adding
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DONNX_ML=1 -Wall")
and target_link_libraries(main /usr/local/lib/libprotobuf.so)
target_link_libraries(main /usr/local/lib/libprotobuf.so)
@zccyman hello, do you remember how to solve it?
No branches or pull requests
I compile "TensorRT-introduction", but have some error as follow:
CMakeLists.txt
The text was updated successfully, but these errors were encountered: