# Build VS 2015, Opencv 4.5.1 with cuda 11.0: LNK1210 exceeded internal ILK size limit(error only on debug mode)

**URL:** <https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646>\
**Category:** Uncategorized\
**Tags:** build\
**Created:** [June 2, 2021, 3:39pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646 "2021-06-02T15:39:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jimmy\_Hung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jimmy_hung/32/2276_2.png) [@Jimmy\_Hung](https://forum.opencv.org/u/Jimmy_Hung)\
**Post date:** [June 2, 2021, 3:39pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/1 "2021-06-02T15:39:33Z")

</div>

Error only shows on Debug mode.

| Severity | Code | Description | Project | File | Line | Suppression State |
| --- | --- | --- | --- | --- | --- | --- |
| Error | LNK1210 | exceeded internal ILK size limit; link with /INCREMENTAL:NO | opencv\_world | C:\Working\opencv-4.5.1\build\modules\world\LINK | 1 | |

Please give me a suggestion.

Thank

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 2, 2021, 4:00pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/2 "2021-06-02T16:00:25Z")

</div>

run cmake with `-D BUILD_opencv_world=OFF` (or find that key in `cmake-gui`)

that’ll link individual modules rather than one big `world` module.

or do what the error says, which is some configuration in the stated VS project.

---

<div class="post-metadata">

**Author:** ![Jimmy\_Hung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jimmy_hung/32/2276_2.png) [@Jimmy\_Hung](https://forum.opencv.org/u/Jimmy_Hung)\
**Post date:** [June 2, 2021, 4:15pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/3 "2021-06-02T16:15:48Z")

</div>

Thanks, Because that is a part of my project, i need xxxx\_wordyyy.lib for another project. Is there a way to overcome that instead of turning it off?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 2, 2021, 4:18pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/4 "2021-06-02T16:18:27Z")

</div>

> [@crackwitz](#):
>
> or do what the error says, which is some configuration in the stated VS project.

can you find the setting that’s mentioned in the error in the VS project settings?

---

<div class="post-metadata">

**Author:** ![Jimmy\_Hung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jimmy_hung/32/2276_2.png) [@Jimmy\_Hung](https://forum.opencv.org/u/Jimmy_Hung)\
**Post date:** [June 2, 2021, 4:29pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/5 "2021-06-02T16:29:52Z")

</div>

I tried some ways but still get error, the error code is no longer existed on visual studio 2015 64bit.  
Is there away to remove unused extra modules to get a smaller project?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 2, 2021, 4:31pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/6 "2021-06-02T16:31:08Z")

</div>

yes, uncheck those you don’t want in `cmake-gui`. that’s the easiest method.

---

<div class="post-metadata">

**Author:** ![Jimmy\_Hung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jimmy_hung/32/2276_2.png) [@Jimmy\_Hung](https://forum.opencv.org/u/Jimmy_Hung)\
**Post date:** [June 2, 2021, 4:47pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/7 "2021-06-02T16:47:22Z")

</div>

do they depend on each other ?

List of objects that we used on our project:

```
cv::ogl::Texture2D 	
cv::Exception
cv::cuda::GpuMat 
cv::InputArray
cv::String
cv::VideoCapture
cv::Mat 
cv::VideoCaptureProperties
cv::cuda::cvtColor
cv::cuda::split
cv::Size 
cv::cuda::resize
cv::ogl::Texture2D
cv::cuda::getCudaEnabledDeviceCount
cv::cuda::cvtColor
cv::demosaicing
cv::ogl::Buffer 
cv::cuda::SparsePyrLKOpticalFlow::create
cv::Point2f
cv::Point2f
cv::cuda::cvtColor
cv::Point2f
cv::Ptr
cv::cuda::SparsePyrLKOpticalFlow
cv::flip		
cv::cuda::getCudaEnabledDeviceCount

```

How do we address which modules they come ?

Or we could use another builder tool instead msbuilder

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 2, 2021, 5:00pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/8 "2021-06-02T17:00:40Z")

</div>

you’ll need

- surely: core, highgui, videoio
- maybe: imgproc, imgcodecs
- make sure to keep `WITH_OPENGL`
- cudaoptflow, cudastereo, not sure what else

I can’t say what you won’t need.

some modules might depend on each other. the cmake configuration step will tell you if anything conflicts.

run `print(cv.getBuildInformation())` if you want to see the final report from the cmake configuration step. it lists the modules. example:

```nohighlight
  OpenCV modules:
    To be built: alphamat aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled: gapi java_bindings_generator js_bindings_generator objc_bindings_generator python_tests world
    Disabled by dependency: -
    Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2
    Applications: apps
    Documentation: NO
    Non-free algorithms: YES

```

---

<div class="post-metadata">

**Author:** ![Jimmy\_Hung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jimmy_hung/32/2276_2.png) [@Jimmy\_Hung](https://forum.opencv.org/u/Jimmy_Hung)\
**Post date:** [June 2, 2021, 5:05pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/9 "2021-06-02T17:05:50Z")

</div>

Thanks for your support,  
One more thing, i dont know why no body here faced the issues or i did some thing wrong.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 2, 2021, 5:08pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/10 "2021-06-02T17:08:38Z")

</div>

most people either

- only build the main repository and no contrib code (cuda is contrib), then the world library’s size is manageable
- _don’t_ link everything into a `world` library but individual module libraries (opencv\_core, opencv\_highgui, …)

your other project doesn’t have to link against opencv\_world. it can just as well link against the specific module libraries it actually uses. `ppencv_world` is a mere convenience. one might even say it’s for lazy people.

---

<div class="post-metadata">

**Author:** ![Jimmy\_Hung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jimmy_hung/32/2276_2.png) [@Jimmy\_Hung](https://forum.opencv.org/u/Jimmy_Hung)\
**Post date:** [June 2, 2021, 5:13pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/11 "2021-06-02T17:13:40Z")

</div>

You meant that we should attach contrib modules into the project instead of putting them on opencv\_world ?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [June 2, 2021, 5:16pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/12 "2021-06-02T17:16:43Z")

</div>

no, I’m saying to set `BUILD_opencv_world=OFF` and then

> [@Jimmy\_Hung](#):
>
> i need xxxx\_wordyyy.lib for another project

in **that** project you do _not_ link against opencv\_world but against opencv\_core and whatever other modules you actually use there.

or to set that configuration in VS that your error message told you to set.

you have a choice here. both ways work.

---

<div class="post-metadata">

**Author:** ![Jimmy\_Hung](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/jimmy_hung/32/2276_2.png) [@Jimmy\_Hung](https://forum.opencv.org/u/Jimmy_Hung)\
**Post date:** [June 2, 2021, 5:18pm UTC](https://forum.opencv.org/t/build-vs-2015-opencv-4-5-1-with-cuda-11-0-lnk1210-exceeded-internal-ilk-size-limit-error-only-on-debug-mode/3646/13 "2021-06-02T17:18:14Z")

</div>

> [@crackwitz](#):
>
> n **that** project you do _not_ link against opencv\_world but against opencv\_core and whatever other modules you actually use there.
> 
> or to set that configuration in VS that your error message told you to set.
> 
> you have a choice here. both ways work.

Thank you 🙂
