Vcpkg: openCV debug mode LNK2019 / LNK1120 error

Created on 19 Jul 2020  路  11Comments  路  Source: microsoft/vcpkg

Hello,

I'm trying to build a x64-windows project in debug mode but I get the following two errors:

Error | LNK2019 | unresolved external symbol "void __cdecl cv::cvtColor(class cv::_InputArray const &,class cv::_OutputArray const &,int,int)" (?cvtColor@cv@@YAXAEBV_InputArray@1@AEBV_OutputArray@1@HH@Z) referenced in function "public: static void __cdecl IntensityToRGBConverter::WinterColormap(double,double *)" (?WinterColormap@IntensityToRGBConverter@@SAXNPEAN@Z) | AMADEUS | C:\MA_Repo\30_Code\85_Code_Gruenewald\01_RTMaps\MyRTMaps_SDK\AMADEUS.u\Intensity_To_RGB_Converter.obj | 1 | 聽

Error | LNK1120 | 1 unresolved externals | AMADEUS | C:\MA_Repo\30_Code\85_Code_Gruenewald\01_RTMaps\MyRTMaps_SDK\packages\debug\AMADEUS.pck | 1 | 聽

The build errors are disappearing when I switch to release mode.

I use vcpkg version f2e9ef7f259843e116453bbabb7bcc2b13246f13, with

opencv4:x64-windows 4.1.1-3 computer vision library
opencv4[dnn]:x64-windows Enable dnn module
opencv4[jpeg]:x64-windows JPEG support for opencv
opencv4[opengl]:x64-windows opengl support for opencv
opencv4[png]:x64-windows PNG support for opencv
opencv4[tiff]:x64-windows TIFF support for opencv
opencv4[webp]:x64-windows WebP support for opencv
opencv:x64-windows 4.1.1-1 Computer vision library
opencv[dnn]:x64-windows Enable dnn module
opencv[jpeg]:x64-windows JPEG support for opencv
opencv[opengl]:x64-windows opengl support for opencv
opencv[png]:x64-windows PNG support for opencv
opencv[tiff]:x64-windows TIFF support for opencv
opencv[webp]:x64-windows WebP support for opencv

Why is this happening?

Thanks in advance!

port-bug

All 11 comments

Hi @jagrme00
Thanks for posting this issue.
Could you please try to rebuild this based on PR #11130?

Well I can try it, but this changes my local repo to version dbfe6cc1ca3ce3532b768acd2ccd8c60616a412f. Thus the version of the Point Cloud Library (PCL) that I also need for my project gets changed from 1.9.1-11 to 1.9.1-13 and this will break my code since not all features are included in the current PCL version.

Is it possible to run two separate vcpkg versions in parallel one for PCL and the other for OpenCV to overcome this issue or is there a better solution?

Thanks!

@jagrme00
You can merge the two changes to one branch and then try to rebuild. Since there are too many changes in PR #11130. You can update the changes for PCLto PR #11130.

Okay. Since I am not working with git on a daily basis can you explain this with a little bit more details please?

I tried the following:

1) git clone https://github.com/Microsoft/vcpkg.git

2) git checkout f2e9ef7f259843e116453bbabb7bcc2b13246f13

3) git fetch origin pull/11130/head:TEST

4) git merge TEST

I am 100% sure that these are the wrong steps because I ended up with PCL 1.9.1-13 again...

@jagrme00
you might try to use the following steps:

Or you can wait for the PR merged into master and then try this again.

@jagrme00
you might try to use the following steps:

Or you can wait for the PR merged into master and then try this again.

@NancyLi1013 @jagrme00 to do it with less line:

Hi @jagrme00
opencv4 has been updated to 4.3 via PR #11130.

Now you can update vcpkg to the latest version and try to rebuild if this can work for you.

@jagrme00
Please provide the project case if this is still a problem for you now.

Thanks.

@NancyLi1013 sorry for my delay. Currently I have some other topics which require more attention than this issue.
I'll try the suggestions within the next few days and I'll let you know my results.

Thanks for your help.

My problems are solved now. The above mentioned approach https://github.com/microsoft/vcpkg/issues/12487#issuecomment-664813848 is working for me.
Thank you @NancyLi1013 for you help!

Thanks for your update.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madkoala picture madkoala  路  3Comments

cjvaijo picture cjvaijo  路  3Comments

PhilLab picture PhilLab  路  3Comments

pakdel picture pakdel  路  3Comments

husseinalihazime picture husseinalihazime  路  3Comments