Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openCV debug mode LNK2019 / LNK1120 error #12487

Closed
jagrme00 opened this issue Jul 19, 2020 · 11 comments
Closed

openCV debug mode LNK2019 / LNK1120 error #12487

jagrme00 opened this issue Jul 19, 2020 · 11 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@jagrme00
Copy link

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 f2e9ef7, 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!

@NancyLi1013
Copy link
Contributor

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

@jagrme00
Copy link
Author

Well I can try it, but this changes my local repo to version dbfe6cc. 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!

@NancyLi1013
Copy link
Contributor

@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 PCL to PR #11130.

@jagrme00
Copy link
Author

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:/Microsoft/vcpkg.git

  2. git checkout f2e9ef7

  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...

@NancyLi1013
Copy link
Contributor

@jagrme00
you might try to use the following steps:

  • git clone https:/cenit/vcpkg.git
  • cd vcpkg
  • git checkout -b dev/cenit/opencv43 origin/dev/cenit/opencv43
  • merge PCL updates to this repo manually

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

@talregev
Copy link
Contributor

talregev commented Jul 23, 2020

@jagrme00
you might try to use the following steps:

  • git clone https:/cenit/vcpkg.git
  • cd vcpkg
  • git checkout -b dev/cenit/opencv43 origin/dev/cenit/opencv43
  • merge PCL updates to this repo manually

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

@NancyLi1013 @jagrme00 to do it with less line:

@NancyLi1013
Copy link
Contributor

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.

@NancyLi1013
Copy link
Contributor

NancyLi1013 commented Aug 10, 2020

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

Thanks.

@NancyLi1013 NancyLi1013 added the requires:more-information This Issue requires more information to solve label Aug 13, 2020
@jagrme00
Copy link
Author

@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.

@jagrme00
Copy link
Author

My problems are solved now. The above mentioned approach #12487 (comment) is working for me.
Thank you @NancyLi1013 for you help!

@NancyLi1013
Copy link
Contributor

Thanks for your update.

@NancyLi1013 NancyLi1013 added category:port-bug The issue is with a library, which is something the port should already support and removed requires:more-information This Issue requires more information to solve labels Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

3 participants