# Unable to link with manually compiled OpenCV

**URL:** <https://forum.opencv.org/t/unable-to-link-with-manually-compiled-opencv/18627>\
**Category:** C++\
**Created:** [August 31, 2024, 12:57am UTC](https://forum.opencv.org/t/unable-to-link-with-manually-compiled-opencv/18627 "2024-08-31T00:57:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trylz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/trylz/32/10999_2.png) [@Trylz](https://forum.opencv.org/u/Trylz)\
**Post date:** [August 31, 2024, 12:57am UTC](https://forum.opencv.org/t/unable-to-link-with-manually-compiled-opencv/18627/1 "2024-08-31T00:57:10Z")

</div>

I am migrating my software from OpenCv 3.2.0 to 4.10.0. I need to have support of the **dnn\_superres** module. So I have to build OpenCV myself.

Thanks to [this topic](https://forum.opencv.org/t/how-to-make-a-monolitic-build-of-opencv/18609/3) I successfully compiled the monolithic library. Here the release .LIB and .DLL i obtained:

> **[opencv\_world4100.zip](https://wetransfer.com/downloads/e541b63e99a71fc120146b65d1d4afb420240829031625/f93397)**
>
> 1 file sent via WeTransfer, the simplest way to send your files around the world

Now when I build my software while linking with **opencv\_world4100.lib** i get linking errors:

_1\>Core.lib(Image.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_1\>Core.lib(ForwardLighting.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_1\>AssetPanel.obj : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_1\>Core.lib(BaseModel.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_1\>Core.lib(RenderLights.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_1\>Core.lib(DX12Renderer.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_

However linking with the **opencv\_world4100.lib** from OpenCV 4.10.0 .exe package works.

**Please am i missing anything?**

**I have a workaround that is working:**

1. I use the opencv\_world4100.lib from github .EXE package
2. I manually compile a non monolithic build including the extra modules
3. I link with **opencv\_dnn\_superres4100.lib** in addition to **opencv\_world4100.lib** from OpenCV 4.10.0 .exe

This works but i would like to do the things properly. Especially since I would need to compile OpenCV with **OPENCV\_IMGCODECS\_USE\_OPENEXR** enabled

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [August 31, 2024, 5:48am UTC](https://forum.opencv.org/t/unable-to-link-with-manually-compiled-opencv/18627/2 "2024-08-31T05:48:42Z")

</div>

> [@Trylz](#):
>
> debug\_build\_guard

your project is in DEBUG mode, the lib in RELEASE. bad fit, it expects special signatures, which are not there.

---

<div class="post-metadata">

**Author:** ![Trylz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/trylz/32/10999_2.png) [@Trylz](https://forum.opencv.org/u/Trylz)\
**Post date:** [September 1, 2024, 1:33am UTC](https://forum.opencv.org/t/unable-to-link-with-manually-compiled-opencv/18627/3 "2024-09-01T01:33:28Z")

</div>

Hello Berak 🙂 Thank you very much for helping!

I mistaken I get these errors in Debug build.

So  
**Release build**

> **[opencv\_world4100.zip](https://wetransfer.com/downloads/e541b63e99a71fc120146b65d1d4afb420240829031625/f93397)**
>
> 1 file sent via WeTransfer, the simplest way to send your files around the world

I get this error  
_2\>AssetPanel.obj : error LNK2001: 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)_

**Debug build**

> **[opencv\_world4100d.zip](https://wetransfer.com/downloads/b024bd42952e92aef12157a3d8c6fe6b20240901013101/50785b)**
>
> 1 file sent via WeTransfer, the simplest way to send your files around the world

I get these errors  
_2\>Core.lib(Image.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_2\>Core.lib(ForwardLighting.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_2\>AssetPanel.obj : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_2\>Core.lib(BaseModel.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_2\>Core.lib(RenderLights.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_  
_2\>Core.lib(DX12Renderer.obj) : error LNK2001: unresolved external symbol “void \_\_cdecl cv::cvtColor(class cv::debug\_build\_guard::\_InputArray const &,class cv::debug\_build\_guard::\_OutputArray const &,int,int)” (?cvtColor@cv@@YAXAEBV\_InputArray@debug\_build\_guard@1@AEBV\_OutputArray@31@HH@Z)_

Thanks!
