# Topic: OpenCV error in code::blocks

**URL:** <https://forum.opencv.org/t/topic-opencv-error-in-code-blocks/24428>\
**Category:** C++\
**Tags:** build\
**Created:** [April 14, 2026, 2:49pm UTC](https://forum.opencv.org/t/topic-opencv-error-in-code-blocks/24428 "2026-04-14T14:49:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhongramatickus](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@jhongramatickus](https://forum.opencv.org/u/jhongramatickus)\
**Post date:** [April 14, 2026, 2:49pm UTC](https://forum.opencv.org/t/topic-opencv-error-in-code-blocks/24428/1 "2026-04-14T14:49:39Z")

</div>

I’m trying to use OpenCV (version 4.12.0) in Code::Blocks (version 25.03). When installing OpenCV, I used CMake to generate the libraries in Code::Blocks and Mingw. Once I obtained openCV.cbp, I compiled it in Code::Blocks to generate the libraries. After that, I opened **code::blocks\<\<file\<\<new\<\<project\<\<openCV project\<\< next\<\<next\<\<next\<\<** and I got the following error:

> ```auto
> the lib path you entered seems invalid, can't find files 
> 
> C:\opencv\build\x86\mingw\lib\libopencv_core121.dll.a or 
> 
> C:\opencv\build\x86\mingw\lib\libopencv_core121d.dll.a 
> 
> ```

I created the **x86\<\<mingw** folder so that cmake would generate the files in that location. Despite searching for help on Stack Overflow and other sites, I found no answers. _I renamed the library libopencv\_core4120.dll to libopencv\_core121d.dll.a and it worked fine until yesterday_. Now I’ve deleted code::blocks and OpenCV, regenerated the libraries, and when I try to use any program that has an OpenCV library, I get the message:

> ```auto
> "Code execution cannot continue because libopencv:core4110.dll
> was not found.This problem can be solved by reinstalling the
> program." I got the same message for libopencv_imgcodecs4120.dll.
> and also libopencv_imgproc4120.dll.
> 
> ```

Before attempting to create code using OpenCV’s Code::Blocks project, I added it only to **Settings \<\<Compiler \<\<Linker Settings** and the directory to **Settings \<\<Compiler \<\<Search Directories**. I’ve since removed everything, but I’m still getting the same errors, both when creating a project using OpenCV’s **code::blocks\<\<file\<\<new\<\<project\<\<openCV project\<\< next\<\<next\<\<next\<\<** and when creating a regular file just mentioning the OpenCV libraries. Sometimes, even a simple “Hello World” code won’t compile because of these OpenCV problems.

---

<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:** [April 14, 2026, 7:47pm UTC](https://forum.opencv.org/t/topic-opencv-error-in-code-blocks/24428/2 "2026-04-14T19:47:54Z")

</div>

> [@jhongramatickus](#):
>
> `121`

Code::Blocks appears to be out of date by _ **over two decades.** _

either that or whatever template you use for “openCV project” is out of date by decades.

we can’t help with that.

where **did** you get that project template from?

[someone else](https://stackoverflow.com/questions/79920687/cannot-find-libopencv-core121-dll-a-when-adding-opencv-4-12-0-in-codeblocks) recently asked about the exact same issue on Stack Overflow. maybe you are that person.
