Skip to content
New issue

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

error: a nonstatic member reference must be relative to a specific object #35

Open
X-funbean opened this issue Aug 13, 2020 · 1 comment

Comments

@X-funbean
Copy link

Hi, I'm trying to compile this project on Ubuntu18.04, and I've written a Cmakelist.txt:

cmake_minimum_required(VERSION 3.15)
set(CMAKE_CUDA_COMPILER /usr/local/cuda-10.0/bin/nvcc)
set(CMAKE_CUDA_FLAGS -arch=sm_75)
#set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -ccbin /usr/local/cuda-10.0/bin/nvcc")
project(COCO_track LANGUAGES CUDA CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CUDA_STANDARD 14)

# TensorRT 7
set(TensorRT_7_DIR "/home/xfb/Programs/TensorRT/7.0.0.11")
include_directories("${TensorRT_7_DIR}/include")
set(TensorRT_7_LIBDIR "${TensorRT_7_DIR}/lib")
file(GLOB TensorRT_7_LIBS "${TensorRT_7_LIBDIR}/*.so")

# CUDA 10.0
set(CUDA_DIR "/usr/local/cuda-10.0")
include_directories("${CUDA_DIR}/include")
set(CUDA_LIBDIR "${CUDA_DIR}/lib64")
file(GLOB CUDA_LIBS "${CUDA_LIBDIR}/*.so")

# OpenCV
set(OpenCV_DIR "/usr/local/lib/cmake/opencv4")
find_package(OpenCV REQUIRED)

# Protobuf
set(Protobuf_DIR "/usr/local/include/google/protobuf")
include_directories("${Protobuf_DIR}")
set(Protobuf_LIB /usr/local/lib/libprotobuf.so)

# common files for sample projects
include_directories(builder caffeplugin common examples infer onnx_parser)
include_directories(${PROJECT_SOURCE_DIR})

file(GLOB caffeplugin_src "caffeplugin/*.cpp" "caffeplugin/plugins/*.cu")
file(GLOB common_src "common/*.cpp")
file(GLOB infer_src "infer/*.cpp" "infer/*.cu")
file(GLOB examples_src "examples/*.cpp")
file(GLOB onnx_src "onnx/*.cpp")
file(GLOB onnx_parser_src "onnx_parser/*.cpp" "onnx_parser/*.cu")
file(GLOB onnxplugin_src onnxplugin/onnxplugin.cpp "onnxplugin/plugins/*.cu")

add_executable(COCO_track
        builder/trt_builder.cpp
        ${caffeplugin_src}
        ${common_src}
        ${examples_src}
        ${infer_src}
        ${onnx_src}
        ${onnx_parser_src}
        ${onnxplugin_src}
        import_lib.cpp
        main.cpp
        )

target_link_directories(COCO_track PUBLIC builder caffeplugin common examples infer onnx onnx_parser)
target_link_directories(COCO_track PUBLIC "${TensorRT_7_DIR}/include")
target_link_directories(COCO_track PUBLIC "${CUDA_DIR}/include")
target_link_directories(COCO_track PUBLIC "${Protobuf_DIR}")
target_link_libraries(COCO_track ${TensorRT_7_LIBS} ${CUDA_LIBS} ${OpenCV_LIBS} ${Protobuf_LIB})

However, when I built the project, I met the following error a couple of times:

/usr/include/c++/7/debug/safe_unordered_container.h(71): error: a nonstatic member reference must be relative to a specific object

Any idea on how to debug this error? Many thanks!

@leon5678
Copy link

leon5678 commented Sep 6, 2021

Did you solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants