Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Nemes__Adam
Beginner
359 Views

INCLUDE Inference engine in C++ project

Hi

I want to use inference engine in my C++ project.

Its working fine if i edit one of the sample appliactions,

but if i want to create an applicaion from zero i stuck.

Here is what i tried:

Windows 10(64 bit)

Microsoft Visual Studio 2019

I Added the following to the enviroment variables:

C:\Program Files (x86)\IntelSWTools\openvino_2020.1.033\inference_engine\bin\intel64\Debug;
C:\Program Files (x86)\IntelSWTools\openvino_2020.1.033\opencv\bin;
C:\Program Files (x86)\IntelSWTools\openvino_2020.1.033\deployment_tools\inference_engine\external\tbb\bin;
C:\Program Files (x86)\IntelSWTools\openvino_2020.1.033\deployment_tools\ngraph\lib;
C:\Program Files (x86)\IntelSWTools\openvino_2020.1.033\inference_engine\bin\intel64\Release;
 

 

I created a new C++ console app 

I included the following path:

C:\Program Files (x86)\IntelSWTools\openvino_2020.1.033\deployment_tools\inference_engine\include

In my main cpp:

#include <inference_engine.hpp>

using namespace InferenceEngine;

It finds the inference_engine.hpp, but i got 18 unresolved externals when I try to build it:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class InferenceEngine::CNNNetwork & __cdecl InferenceEngine::CNNNetwork::operator=(class InferenceEngine::CNNNetwork const &)" (__imp_??4CNNNetwork@InferenceEngine@@QEAAAEAV01@AEBV01@@Z) referenced in function "public: void __cdecl object_detector::init(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,int)" (?init@object_detector@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0HH@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: __cdecl InferenceEngine::details::InferenceEngineException::InferenceEngineException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (__imp_??0InferenceEngineException@details@InferenceEngine@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) referenced in function "public: class InferenceEngine::InferRequest __cdecl InferenceEngine::ExecutableNetwork::CreateInferRequest(void)" (?CreateInferRequest@ExecutableNetwork@InferenceEngine@@QEAA?AVInferRequest@2@XZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: __cdecl InferenceEngine::details::InferenceEngineException::InferenceEngineException(class InferenceEngine::details::InferenceEngineException const &)" (__imp_??0InferenceEngineException@details@InferenceEngine@@QEAA@AEBV012@@Z) referenced in function "public: class InferenceEngine::InferRequest __cdecl InferenceEngine::ExecutableNetwork::CreateInferRequest(void)" (?CreateInferRequest@ExecutableNetwork@InferenceEngine@@QEAA?AVInferRequest@2@XZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: __cdecl InferenceEngine::CNNNetwork::CNNNetwork(class InferenceEngine::CNNNetwork const &)" (__imp_??0CNNNetwork@InferenceEngine@@QEAA@AEBV01@@Z) referenced in function "private: class InferenceEngine::CNNNetwork __cdecl object_detector::load_intermediate_representation(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?load_intermediate_representation@object_detector@@AEAA?AVCNNNetwork@InferenceEngine@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: void __cdecl InferenceEngine::Data::setPrecision(class InferenceEngine::Precision const &)" (__imp_?setPrecision@Data@InferenceEngine@@QEAAXAEBVPrecision@2@@Z) referenced in function "private: void __cdecl object_detector::prepare_output_blobs(void)" (?prepare_output_blobs@object_detector@@AEAAXXZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: virtual __cdecl InferenceEngine::details::InferenceEngineException::~InferenceEngineException(void)" (__imp_??1InferenceEngineException@details@InferenceEngine@@UEAA@XZ) referenced in function "public: class InferenceEngine::InferRequest __cdecl InferenceEngine::ExecutableNetwork::CreateInferRequest(void)" (?CreateInferRequest@ExecutableNetwork@InferenceEngine@@QEAA?AVInferRequest@2@XZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: virtual __cdecl InferenceEngine::CNNNetwork::~CNNNetwork(void)" (__imp_??1CNNNetwork@InferenceEngine@@UEAA@XZ) referenced in function "public: void __cdecl object_detector::init(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,int)" (?init@object_detector@@QEAAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0HH@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: virtual unsigned __int64 __cdecl InferenceEngine::CNNNetwork::getBatchSize(void)const " (__imp_?getBatchSize@CNNNetwork@InferenceEngine@@UEBA_KXZ) referenced in function "private: class InferenceEngine::CNNNetwork __cdecl object_detector::load_intermediate_representation(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?load_intermediate_representation@object_detector@@AEAA?AVCNNNetwork@InferenceEngine@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > const & __cdecl InferenceEngine::TensorDesc::getDims(void)const " (__imp_?getDims@TensorDesc@InferenceEngine@@QEBAAEBV?$vector@_KV?$allocator@_K@std@@@std@@XZ) referenced in function "private: void __cdecl object_detector::prepare_output_blobs(void)" (?prepare_output_blobs@object_detector@@AEAAXXZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class std::vector<unsigned __int64,class std::allocator<unsigned __int64> > & __cdecl InferenceEngine::TensorDesc::getDims(void)" (__imp_?getDims@TensorDesc@InferenceEngine@@QEAAAEAV?$vector@_KV?$allocator@_K@std@@@std@@XZ) referenced in function "private: void __cdecl object_detector::prepare_input(class InferenceEngine::InferRequest &,class std::vector<float,class std::allocator<float> >)" (?prepare_input@object_detector@@AEAAXAEAVInferRequest@InferenceEngine@@V?$vector@MV?$allocator@M@std@@@std@@@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl InferenceEngine::Core::GetAvailableDevices(void)const " (__imp_?GetAvailableDevices@Core@InferenceEngine@@QEBA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ) referenced in function "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl object_detector::getAvailableDevices(void)" (?getAvailableDevices@object_detector@@QEAA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class InferenceEngine::TensorDesc const & __cdecl InferenceEngine::Data::getTensorDesc(void)const " (__imp_?getTensorDesc@Data@InferenceEngine@@QEBAAEBVTensorDesc@2@XZ) referenced in function "private: void __cdecl object_detector::prepare_output_blobs(void)" (?prepare_output_blobs@object_detector@@AEAAXXZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class InferenceEngine::ExecutableNetwork __cdecl InferenceEngine::Core::LoadNetwork(class InferenceEngine::CNNNetwork,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > const &)" (__imp_?LoadNetwork@Core@InferenceEngine@@QEAA?AVExecutableNetwork@2@VCNNNetwork@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@6@@Z) referenced in function "private: class InferenceEngine::ExecutableNetwork __cdecl object_detector::load_model_to_device(class InferenceEngine::CNNNetwork &)" (?load_model_to_device@object_detector@@AEAA?AVExecutableNetwork@InferenceEngine@@AEAVCNNNetwork@3@@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class InferenceEngine::details::InferenceEngineException & __cdecl InferenceEngine::details::InferenceEngineException::operator<<(class InferenceEngine::details::InferenceEngineException & (__cdecl*)(class InferenceEngine::details::InferenceEngineException &))" (__imp_??6InferenceEngineException@details@InferenceEngine@@QEAAAEAV012@P6AAEAV012@AEAV012@@Z@Z) referenced in function "void __cdecl InferenceEngine::details::extract_exception(enum InferenceEngine::StatusCode,char *)" (?extract_exception@details@InferenceEngine@@YAXW4StatusCode@2@PEAD@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) public: class InferenceEngine::CNNNetwork __cdecl InferenceEngine::Core::ReadNetwork(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (__imp_?ReadNetwork@Core@InferenceEngine@@QEBA?AVCNNNetwork@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z) referenced in function "private: class InferenceEngine::CNNNetwork __cdecl object_detector::load_intermediate_representation(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?load_intermediate_representation@object_detector@@AEAA?AVCNNNetwork@InferenceEngine@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2019	unresolved external symbol "__declspec(dllimport) private: struct std::pair<enum InferenceEngine::StatusCode,bool> __cdecl InferenceEngine::details::InferenceEngineException::status_code_assign(enum InferenceEngine::StatusCode const &)" (__imp_?status_code_assign@InferenceEngineException@details@InferenceEngine@@AEAA?AU?$pair@W4StatusCode@InferenceEngine@@_N@std@@AEBW4StatusCode@3@@Z) referenced in function "public: class InferenceEngine::details::InferenceEngineException & __cdecl InferenceEngine::details::InferenceEngineException::operator<<<enum InferenceEngine::StatusCode>(enum InferenceEngine::StatusCode const &)" (??$?6W4StatusCode@InferenceEngine@@@InferenceEngineException@details@InferenceEngine@@QEAAAEAV012@AEBW4StatusCode@2@@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2001	unresolved external symbol "public: __cdecl InferenceEngine::details::InferenceEngineException::InferenceEngineException(class InferenceEngine::details::InferenceEngineException const &)" (??0InferenceEngineException@details@InferenceEngine@@QEAA@AEBV012@@Z)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK2001	unresolved external symbol "public: virtual __cdecl InferenceEngine::details::InferenceEngineException::~InferenceEngineException(void)" (??1InferenceEngineException@details@InferenceEngine@@UEAA@XZ)	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\OpenVinoobjectDetection\object_detector.obj	1	
Error	LNK1120	18 unresolved externals	OpenVinoobjectDetection	C:\Code\OpenVINO\OpenVinoobjectDetection\x64\Debug\OpenVinoobjectDetection.exe	1	

Is there anything else i should include, or how else can i solve this problem?

Any idea where i should dig around?

Thanks

!S

0 Kudos
4 Replies
Nemes__Adam
Beginner
359 Views

Solution:

Adding the inference_engine.lib to project.

Nemes__Adam
Beginner
359 Views

Solution:

Adding the inference_engine.lib to project.

JAIVIN_J_Intel
Employee
359 Views

Hi Adam,

Thanks for sharing the information with OpenVINO Community!

Regards,

Jaivin

Mrzljak__Nikola
Beginner
359 Views

Hi,

I have a similar problem.

I have added the inference_engine.lib (I'm working with 2020.2) and I'm getting linker errors (LNK2019) about missing the InferenceEngineException, TensorDesc constructor and multiple other symbols.

This started happening after upgrading from 2019.R3 to 2020.2.

Do you have an idea what could it be?

I haven't found any info on it, but should I add some other lib files to the linker? I see that there are some new libs.

Best regards,

Nikola

---------------------------------------------------------------------------------------------------------

In the end, the problem was I wasn't linking inference_engine_legacy.lib