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.

Build Error on LNK2001

WeiSeng
Employee
2,910 Views

Prerequisite:

- Window10 OS

- Install OpenVINO 2023.0

 

When we try to setting the openVINO path point to our working directory cause build error:

__declspec(dllimport)  class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>>cdecl

ov::node_validation_failure_loc_string(class ov::Node const*)" (imp_? node_validation_failure_loc_string@@ov@@YA?AV$basic_string@DU?

$char_traits@D@std@@V$allocator@D@2@@std@@PEBVNODE@1@@Z)

 

I also attached the error message picture.

 

Please point me where to configure in order solve this issue?

 

0 Kudos
14 Replies
Iffa_Intel
Moderator
2,888 Views

Hi,

 

could you share:

  1. which hardware you are using (eg: laptop with i7 CPU + UHD GPU, Intel SGX, etc) ?
  2. which OpenVINO guides are you following: Runtime on Windows or Build from source ?
  3. which version of Visual Studio are you using?
  4. Steps you've done up till point of error (with commands that you used if possible)

 

 

Cordially,

Iffa

 

0 Kudos
WeiSeng
Employee
2,869 Views

Thanks for supporting us, Iffa!

 

Here my reply:

  1. which hardware you are using (eg: laptop with i7 CPU + UHD GPU, Intel SGX, etc) ?   [Using laptop with i7+UHD GPU, and Window10 OS]
    1. which OpenVINO guides are you following: Runtime on Windows?  [Yes, we're follow the guide to install is working fine. And we move our working directory to new working directory, because we need to integrate with our application. This directory setting: 'C:\solution'
  2. which version of Visual Studio are you using? [visual studio 2019 (16.11.6)]
  3. Steps you've done up till point of error (with commands that you used if possible)

My question is by default openVINO C++ working directory is this 'C:\Program Files (x86)\Intel\openvino_2023'

If we need to move this default directory to this 'C:\solution', what need to be taken care (like environment configuration setting) and what openVINO library folders need to move over in order to building successfully?

 

Thanks again!

 

 

0 Kudos
Iffa_Intel
Moderator
2,856 Views

 

Generally,

 

there are two CMakelist.txt involved when compiling OpenVINO C++ in Windows Runtime(I created a new dir named test):

  1. OVpath\samples\cpp\CMakeLists.txt
  2. OVpath\samples\cpp\object_detection_sample_ssd\CMakeLists.txt

 

I'll leave CMAkeList file at number 1 as it is and edit number 2.

Iffa_Intel_0-1695208771197.png

 

Then, I built it

Iffa_Intel_1-1695208881673.png

The binary is generated without error.

Iffa_Intel_2-1695208945587.png

 

 

Cordially,

Iffa

 

0 Kudos
WeiSeng
Employee
2,845 Views

Hi Iffa,

 

Thanks for information.

 

your working environment still in default : C:\Program Files (x86)\Intel\openvino_2023 ??

 

If our working environment is not in this openVINO default folder directory, mean we put into 'c:\solution', openVINO all the folder need move to our working directory?

 

Or we install openVINO on default directory (mean this C:\Program Files (x86)\Intel\openvino_2023), and just update CMakeList.txt?

 

Thanks for support!

 

Or I can setup a call with you? can you provide me your Intel email?

 

Regards,
WS Yeap 

0 Kudos
Iffa_Intel
Moderator
2,802 Views

 

 

Same concept applies if you change your dir.

Required files/folder: common, thirdparty, build_samples_msvc.bat,CMakeLists.txt

Iffa_Intel_1-1695342210677.png

I created test2 folder with the same content as I've shown before with its CMakelist

 

 

Init setupvars beforehand & compile:

Iffa_Intel_2-1695342385687.png

 

 

Success Compilation:

Iffa_Intel_0-1695342166759.png

Binary produced:

Iffa_Intel_3-1695342516185.png

 

 

Cordially,

Iffa

 

0 Kudos
WeiSeng
Employee
2,735 Views

Thanks Iffa,

 

We managed to solve the linking issue.

Now when we load the dll seem is fail.

 

I attached the picture for you, you can advise us?

 

Thanks!

 

0 Kudos
Iffa_Intel
Moderator
2,725 Views

To answer that, I need more information:

  1. what is your use case? (eg: used inferencing code from OpenVINO sample with YOLO model)
  2. did you make changes to the original OpenVINO setup (files/codes/etc other than the one I showed previously)


Please note that it is best to use the original OpenVINO setup files as it is instead of creating custom ones.



Cordially,

Iffa


0 Kudos
WeiSeng
Employee
2,711 Views

Hi Iffa,

  1. what is your use case? (eg: used inferencing code from OpenVINO sample with YOLO model) The use-cases is for object detection and using YOLO model.
  2. did you make changes to the original OpenVINO setup (files/codes/etc other than the one I showed previously) We updated the CMakeList file, is there any file need to setting to solve the dll loading fail?

 

Thanks!

0 Kudos
Iffa_Intel
Moderator
2,703 Views

 

 

I hope you noticed that there are 2 CMakeList files.

 

Please use the original CMakeList without changes in the main folder, mine is in C:\Users\sjaismex\OV_test

Iffa_Intel_2-1695798546912.png

 

 

The only changeable CMakeList is in your custom (newly created folder), mine is in C:\Users\sjaismex\OV_test\test2:

Iffa_Intel_3-1695798654271.png

 

 

 

Run the setupvars.bat before doing any compilation/build or inferencing.

If you've done this properly as mentioned and your custom inferencing code has no problem, there shouldn't be issue with the setup files/linker.

 

Cordially,

Iffa

 

0 Kudos
WeiSeng
Employee
2,492 Views

Thanks Iffa,

 

One question on the *.dll loading fail still happen.

 

This is the Cmake file that original:

WeiSeng_0-1696402554113.png

 

And the directory that we change the Cmake file:

WeiSeng_1-1696402642200.png

 

1. Build is success

2. When run DEBUG, the DLL load fail like below :

Failed(code:126) to load C:\app\10_siav2_git\18_siav2_edge\bin\x64\Release\jobmodules\Jobmodule_detector_yolo_openvino.dll

 

 

Any suggestions?

 

Thanks!

0 Kudos
Iffa_Intel
Moderator
2,480 Views

 

Edit your build_samples_msvc.bat.

Change

echo "!MSBUILD_BIN!" Samples.sln /p:Configuration=Release
"!MSBUILD_BIN!" Samples.sln /p:Configuration=Release

 

To

echo "!MSBUILD_BIN!" Samples.sln /p:Configuration=Debug
"!MSBUILD_BIN!" Samples.sln /p:Configuration=Debug

 

Then build again as previously done.

You should have Debug folder with its binaries.

Run your dbg with the Debug binary and see whether the issue persist.

Iffa_Intel_0-1696404563615.png

 

Note: don't forget to run setupvars.bat beforehand

 

Cordially,

Iffa

 

0 Kudos
WeiSeng
Employee
2,379 Views

Thanks Iffa,

 

Are we have the guide (in DOC/PDF) on how to configure new project for openVINO for C++ on Windows OS?

 

Thanks!

0 Kudos
Iffa_Intel
Moderator
2,366 Views
0 Kudos
Iffa_Intel
Moderator
2,266 Views

Hi,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question.


Cordially,

Iffa


0 Kudos
Reply