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.

C++ initialize inference engine

ct123
Beginner
1,086 Views

Hi,

 

I am new to working with c++ and openvino. I have been trying to write a windows desktop application with the following code:

 

#include <opencv2/opencv.hpp> //opencv functionality
#include <inference_engine.hpp> //openvino inference engine

using namespace InferenceEngine;

int main()
{
Core myCore;

}

 

The code builds without errors but when I attempt to launch the program I have the following exception:

Unhandled exception at 0x00007FFC0A8A4F69 in main.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00000037A2CFF590.

 

I was able to successfully build the openvino samples. Am I forgetting something?

0 Kudos
5 Replies
ct123
Beginner
1,077 Views

I am able to use openvino with python, but not c++

0 Kudos
ct123
Beginner
1,073 Views

'main.exe' (Win32): Loaded 'C:\Users\ctwombly\source\repos\yolov4\x64\Release\yolov4.exe'. Symbols loaded.
'main.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\sysfer.dll'.
'main.exe' (Win32): Loaded 'C:\Users\ctwombly\source\repos\yolov4\x64\Release\inference_engine.dll'. Module was built without symbols.
'main.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140d.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140d.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1d.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbased.dll'.
'main.exe' (Win32): Loaded 'C:\Users\ctwombly\source\repos\yolov4\x64\Release\tbb.dll'.
'main.exe' (Win32): Loaded 'C:\Users\ctwombly\source\repos\yolov4\x64\Release\inference_engine_transformations.dll'. Module was built without symbols.
'main.exe' (Win32): Loaded 'C:\Users\ctwombly\source\repos\yolov4\x64\Release\ngraph.dll'. Module was built without symbols.
'main.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'.
'main.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1.dll'.
The thread 0x9a14 has exited with code 0 (0x0).
Exception thrown at 0x00007FFC0A8A4F69 in main.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x000000CB924FF9F0.
Unhandled exception at 0x00007FFC0A8A4F69 in main.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x000000CB924FF9F0.

 

0 Kudos
Zulkifli_Intel
Moderator
1,042 Views

Hello ct123,

 

Thank you for reaching out to us.

 

The std::bad_alloc means that you are out of memory. Can you share with us your targeted device for inferencing and step to reproduce the issue?

 

Sincerely,

Zulkifli 


0 Kudos
ct123
Beginner
1,035 Views

Hi,

 

I fixed my issue. I forgot to include a link to inference_engine.lib for the linker in visual studio 2019 and some other environment settings.  Currently working great.

 

Thanks,

Chris

0 Kudos
Zulkifli_Intel
Moderator
965 Views

Hello ct123,


Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.


Sincerely,

Zulkifli


0 Kudos
Reply