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

[Bug] mmdeploy::'StatusDomain': cannot instantiate abstract class #2826

Open
3 tasks done
cravies opened this issue Sep 24, 2024 · 0 comments
Open
3 tasks done

[Bug] mmdeploy::'StatusDomain': cannot instantiate abstract class #2826

cravies opened this issue Sep 24, 2024 · 0 comments

Comments

@cravies
Copy link

cravies commented Sep 24, 2024

Checklist

  • I have searched related issues but cannot get the expected help.
  • 2. I have read the FAQ documentation but cannot get the expected help.
  • 3. The bug has not been fixed in the latest version.

Describe the bug

I have some cpp code running a mmdeploy::Detector and a mmdeploy::PoseDetector.
I have a cmake file that links to a vcpkg toolchain where I have built mmdeploy.
In my main.cpp I include

#include <mmdeploy/detector.hpp>
#include <mmdeploy/pose_detector.hpp>

However, when I compile, I get an error in status_code.h, around the lines

constexpr inline StatusDomain status_domain;
inline constexpr const StatusDomain &StatusDomain::get() { return status_domain; }
'mmdeploy::StatusDomain': cannot instantiate abstract class
C:\Users\Ben_C\Desktop\audio_classifier\SpectrogramMaker\arl-vcpkg\installed\x64-windows\include\mmdeploy\core\status_code.h

My first thought is this is an error in vcpkg. So i also try manually linking to a prebuilt mmdeploy distributable in my cmake file. It occurs in both cases.

Cmake file:

cmake_minimum_required(VERSION 3.20)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(NoBallTest LANGUAGES CXX CUDA)

include(ZeroLive.cmake)
find_package(OpenCV REQUIRED)
find_package(ffmpeg REQUIRED)
find_package(onnxruntime REQUIRED)
find_package(CUDAToolkit REQUIRED)
find_package(wxWidgets REQUIRED COMPONENTS net core base)
find_package(glm CONFIG REQUIRED)
# GETTING MMDEPLOY THROUGH VCPKG
find_package(mmdeploy CONFIG REQUIRED)

# prebuilt mmdeploy... 
#set(MMDeploy_DIR "C:/Users/Ben_C/Desktop/mmdeploy-1.2.0-windows-amd64-cuda11.3/mmdeploy-1.2.0-windows-amd64-cuda11.3/lib/cmake/MMDeploy")
#set(TENSORRT_DIR "C:/Users/Ben_C/Desktop/mmdeploy_fromsource/TensorRT-8.6.1.6")
#set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${MMDeploy_DIR};${TENSORRT_DIR}")
#find_package(MMDeploy REQUIRED)

# A helper function that will copy dlls from each linked library of an  
# interface library to the target's output dir as a post-build step.
function(copy_interface_dlls target interface_lib)
	get_target_property(interface_libs ${interface_lib} INTERFACE_LINK_LIBRARIES)
    foreach(item ${interface_libs})
        get_target_property(dll_location ${item} IMPORTED_LOCATION)
        list(APPEND dll_files ${dll_location})

        add_custom_command(TARGET ${target} POST_BUILD
            COMMAND ${CMAKE_COMMAND} -E copy_if_different
            ${dll_location}
            $<TARGET_FILE_DIR:${target}>
        )
    endforeach()
endfunction()

add_executable(auto_ref WIN32
    src/autoref.cpp 
    src/noname.cpp 
    src/noname.h
    src/autoref_utils.h
    src/autoref_structs.h
    src/ProcessOutputsThread.h
    src/MMInferencerThread.h

	src/MegaInputManager/FakeMegaNB.cpp
    src/MegaInputManager/MegaInputTest.cpp
    src/MegaInputManager/FakeClippingTrigger.cpp
    src/MegaInputManager/rand48.cpp
    src/MegaInputManager/EightBitText.cpp
    src/MegaInputManager/tinyxml2.cpp
    src/MegaInputManager/ZeroLiveMegaSource.h
    src/MegaInputManager/rand48.h
    src/MegaInputManager/tinyxml2.h
    src/MegaInputManager/MegaInputTest.h
    src/MegaInputManager/FakeClippingTrigger.h
    src/MegaInputManager/FakeMegaNB.h
    src/MegaInputManager/DetectionTriggerMessages.h
)

target_link_libraries(auto_ref PRIVATE
    ZeroLive
    onnxruntime onnxruntime_providers_tensorrt 
    ${OpenCV_LIBS}
    ${FFMPEG_LIBRARIES}
    wsock32 ws2_32
    ${wxWidgets_LIBRARIES}
    mmdeploy
)

target_compile_features(auto_ref PUBLIC cxx_std_17)
target_link_directories(auto_ref PRIVATE "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
target_compile_definitions(auto_ref PUBLIC GPROF_USE_NVTX)

I run cmake in my build folder like so, it compiles with no errors

cmake .. -DCMAKE_TOOLCHAIN_FILE="C:\Users\Ben_C\Desktop\audio_classifier\SpectrogramMaker\arl-vcpkg\scripts\buildsystems\vcpkg.cmake" -A x64 -DTENSORRT_DIR="C:\Users\Ben_C\Desktop\mmdeploy_fromsource\TensorRT-8.6.1.6"

Reproduction

Just compiled the solution through visual studio cpp.

Environment

.

Error traceback

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error	C2259	'mmdeploy::StatusDomain': cannot instantiate abstract class	auto_ref	C:\Users\Ben_C\Desktop\audio_classifier\SpectrogramMaker\arl-vcpkg\installed\x64-windows\include\mmdeploy\core\status_code.h	152		
Error	C2259	'mmdeploy::StatusDomain': cannot instantiate abstract class	auto_ref	C:\Users\Ben_C\Desktop\audio_classifier\SpectrogramMaker\arl-vcpkg\installed\x64-windows\include\mmdeploy\core\status_code.h	152
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

1 participant