Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6404 Discussions

dll import error: AddExtension(std::make_shared<Extensions::Cpu::CpuExtensions>(), "CPU")

Gorza__Lorenzo
Beginner
1,030 Views

Hi everybody, 

I've a problem instantiating the OpenVINO inference engine for the intel cpu. When i call AddExtension(std::make_shared<Extensions::Cpu::CpuExtensions>(), "CPU"); on the InferenceEngine instance: 

Core ie;

try

{

ie.AddExtension(std::make_shared<Extensions::Cpu::CpuExtensions>(), "CPU");

}catch (const std::exception& error) {
            std::cout << "Exception inference engine add extension: " << error.what() << std::endl;
            return 1;
        }
        catch (...) {
            std::cout << "Unknown/internal exception happened." << std::endl;
            return 1;
        }

 I get the error: 

 error LNK2001: external symbol "__declspec(dllimport) public: virtual void __cdecl InferenceEngine::Extensions::Cpu::CpuExtensions::GetVersion(struct InferenceEngine::Version const * &)const " (__imp_?GetVersion@CpuExtensions@Cpu@Extensions@InferenceEngine@@UEBAXAEAPEBUVersion@4@@Z) not resolved. 

I've linked the library correctly and imported the .dll. I don't figure what goes wrong. 

 

Thank's for help. 

 

0 Kudos
1 Reply
Luis_at_Intel
Moderator
1,030 Views

Hi Gorza, Lorenzo,

Thanks for reaching out. Looking at one of our samples this is how the ie.AddExtension is used to load the CPU extension. Have you tried something similar? Also you can find more information about the function in the reference documentation here.

// @brief message for user library argument
static const char custom_cpu_library_message[] = "Required for CPU custom layers." \
                                                 "Absolute path to a shared library with the kernels implementation";
DEFINE_string(l, "", custom_cpu_library_message);

Core ie;

try {
   // CPU(MKLDNN) extensions are loaded as a shared library and passed as a pointer to base extension
   IExtensionPtr extension_ptr = make_so_pointer<IExtension>(FLAGS_l);
   ie.AddExtension(extension_ptr, "CPU");
   slog::info << "CPU Extension loaded: " << FLAGS_l << slog::endl;
}

 

Regards,

Luis

Reply