# \#cmake

**URL:** https://forum.opencv.org/tag/cmake/214.md

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

---

## [OpenCV CMake config file sets OpenCV\_FOUND to FALSE](https://forum.opencv.org/t/opencv-cmake-config-file-sets-opencv-found-to-false/24488)

<div class="topic-metadata">

**Author:** [@Dr\_Nic](https://forum.opencv.org/u/Dr_Nic)\
**Replies:** 0\
**Last updated:** [April 30, 2026, 10:01am UTC](https://forum.opencv.org/t/opencv-cmake-config-file-sets-opencv-found-to-false/24488 "2026-04-30T10:01:42Z")

</div>

I’m using CMake to build Depth-Anything-TensorRT I’ve changed the paths to the corresponding path to OpenCV & TensorRT but CMkae keeps throwing the following error (full trace), – Building for: Visual Studio 17 2022 …

---

## [Opencv-contrib C++ VSCode](https://forum.opencv.org/t/opencv-contrib-c-vscode/24303)

<div class="topic-metadata">

**Author:** [@RDS](https://forum.opencv.org/u/RDS)\
**Replies:** 0\
**Last updated:** [January 8, 2026, 11:16am UTC](https://forum.opencv.org/t/opencv-contrib-c-vscode/24303 "2026-01-08T11:16:38Z")

</div>

I’m trying to compile a program using cmake that uses opencv-contrib to use WeChat QRCode in C++ in VSCode on Windows 11. I need: #include \<chrono\> #include \<iostream\> #include \<opencv2/opencv.hpp\> #include \<opencv2/we…

---

## [Build from source for release](https://forum.opencv.org/t/build-from-source-for-release/23841)

<div class="topic-metadata">

**Author:** [@nklskyoy](https://forum.opencv.org/u/nklskyoy)\
**Replies:** 0\
**Last updated:** [August 19, 2025, 10:40am UTC](https://forum.opencv.org/t/build-from-source-for-release/23841 "2025-08-19T10:40:29Z")

</div>

Hi all, I am trying to build OpenCV from source to enable optimzations. I check in the build directory cat CMakeCache.txt | grep CMAKE\_BUILD\_TYPE CMAKE\_BUILD\_TYPE:STRING=Debug //STRINGS property for variable: CMAKE\_B…

---

## [Can not install dlib for face\_recognition](https://forum.opencv.org/t/can-not-install-dlib-for-face-recognition/23515)

<div class="topic-metadata">

**Author:** [@zamigmammadzada](https://forum.opencv.org/u/zamigmammadzada)\
**Replies:** 2\
**Last updated:** [August 14, 2025, 8:27pm UTC](https://forum.opencv.org/t/can-not-install-dlib-for-face-recognition/23515 "2025-08-14T20:27:46Z")

</div>

Hello everyone, I need to download the dlib library for face\_recognition but every time I get this error: “building wheel for dlib (pyproject.toml) did not run successfully” and even though I downloaded the cmake library…

---

## [Persistent CUDA/cuDNN Build Errors (4.12.0, CUDA 12.9, VS2022)](https://forum.opencv.org/t/persistent-cuda-cudnn-build-errors-4-12-0-cuda-12-9-vs2022/23451)

<div class="topic-metadata">

**Author:** [@mercylotus](https://forum.opencv.org/u/mercylotus)\
**Replies:** 7\
**Last updated:** [August 1, 2025, 11:19am UTC](https://forum.opencv.org/t/persistent-cuda-cudnn-build-errors-4-12-0-cuda-12-9-vs2022/23451 "2025-08-01T11:19:29Z")

</div>

Hello, I am attempting to build OpenCV 4.12.0 with CUDA and cuDNN support for use with my python project including EasyOCR. I want GPU acceleration inside my python project. I’ve encountered persistent build errors rel…

---

## [Building OpenCV with CMake - does not install dll/lib files to install dir](https://forum.opencv.org/t/building-opencv-with-cmake-does-not-install-dll-lib-files-to-install-dir/23128)

<div class="topic-metadata">

**Author:** [@snoriman](https://forum.opencv.org/u/snoriman)\
**Replies:** 2\
**Last updated:** [July 15, 2025, 8:07am UTC](https://forum.opencv.org/t/building-opencv-with-cmake-does-not-install-dll-lib-files-to-install-dir/23128 "2025-07-15T08:07:23Z")

</div>

I’m building OpenCV using CMake as an external project and the compilition works well, but the generated lib / dll files are not installed. The headers are correctly installed though. Is there a special build option I s…

---

## [Does OpenCV 4.11.0 have QT support?](https://forum.opencv.org/t/does-opencv-4-11-0-have-qt-support/20405)

<div class="topic-metadata">

**Author:** [@Devin\_11](https://forum.opencv.org/u/Devin_11)\
**Replies:** 3\
**Last updated:** [March 5, 2025, 10:58am UTC](https://forum.opencv.org/t/does-opencv-4-11-0-have-qt-support/20405 "2025-03-05T10:58:18Z")

</div>

I am trying to build a C++ OpenCV application with CMake, I checked the options for the OpenCV config but can not find the WITH\_QT option, so i am confused if I can build a OpenCV 4.11.0 application with Qt GUI interface…

---

## [Opencv-4.9.0 to CMake 3.29.1 Error in configuration process, project files may be invalid](https://forum.opencv.org/t/opencv-4-9-0-to-cmake-3-29-1-error-in-configuration-process-project-files-may-be-invalid/17243)

<div class="topic-metadata">

**Author:** [@hss9205gtt](https://forum.opencv.org/u/hss9205gtt)\
**Replies:** 8\
**Last updated:** [March 4, 2025, 6:39pm UTC](https://forum.opencv.org/t/opencv-4-9-0-to-cmake-3-29-1-error-in-configuration-process-project-files-may-be-invalid/17243 "2025-03-04T18:39:31Z")

</div>

i use to CMake to like this satie here but it is error how to fix it

---

## [OpenCV build error LNK2001: unresolved external symbol "public: \_\_cdecl cv::Mat::Mat(void)"](https://forum.opencv.org/t/opencv-build-error-lnk2001-unresolved-external-symbol-public-cdecl-cv-mat-void/19695)

<div class="topic-metadata">

**Author:** [@Sergey\_Kurchatov](https://forum.opencv.org/u/Sergey_Kurchatov)\
**Replies:** 1\
**Last updated:** [January 7, 2025, 7:33am UTC](https://forum.opencv.org/t/opencv-build-error-lnk2001-unresolved-external-symbol-public-cdecl-cv-mat-void/19695 "2025-01-07T07:33:23Z")

</div>

Hi all, I have downloaded opencv-4.9.0-windows.exe, then I generate the code with CMake (no errors), then I open solution OpenCV.sln and choose “Rebuild all” The compilation is Ok but there are LNK2001 error Namely …

---

## [Build fails during compilation of cudaimgproc](https://forum.opencv.org/t/build-fails-during-compilation-of-cudaimgproc/19655)

<div class="topic-metadata">

**Author:** [@wire\_forest](https://forum.opencv.org/u/wire_forest)\
**Replies:** 11\
**Last updated:** [January 4, 2025, 5:05am UTC](https://forum.opencv.org/t/build-fails-during-compilation-of-cudaimgproc/19655 "2025-01-04T05:05:31Z")

</div>

Hello, I am trying to compile opencv-4.10.0 from source but I am running into a sudden failure during compilation. Below is at the point where make suddenly fails: \[ 66%\] Built target opencv\_text \[ 67%\] Building CXX ob…

---

## [Opencv4.5.2 build error :OpenCVCompilerOptimizations.cmake:593: error: Compiler doesn't support baseline optimization flags: cmake/OpenCVCompilerOptions.cmake:311 (ocv\_compiler\_optimization\_options) CMakeLists.txt:617 (include)](https://forum.opencv.org/t/opencv4-5-2-build-error-opencvcompileroptimizations-cmake-error-compiler-doesnt-support-baseline-optimization-flags-cmake-opencvcompileroptions-cmake-311-ocv-compiler-optimization-options-cmakelists-txt-617-include/18865)

<div class="topic-metadata">

**Author:** [@joe\_hanmy](https://forum.opencv.org/u/joe_hanmy)\
**Replies:** 6\
**Last updated:** [September 30, 2024, 11:41am UTC](https://forum.opencv.org/t/opencv4-5-2-build-error-opencvcompileroptimizations-cmake-error-compiler-doesnt-support-baseline-optimization-flags-cmake-opencvcompileroptions-cmake-311-ocv-compiler-optimization-options-cmakelists-txt-617-include/18865 "2024-09-30T11:41:17Z")

</div>

The compiler is Desktop\_Qt\_5\_14\_2\_MinGW\_64\_bit-Release. Can I disbale those lines: if(NOT HAVE\_CPU\_BASELINE\_FLAGS) message(FATAL\_ERROR “Compiler doesn’t support baseline optimization flags: ${CPU\_BASELINE\_FLAGS}”) e…

---

## [It can work without include\_directories( ${OpenCV\_INCLUDE\_DIRS} )?](https://forum.opencv.org/t/it-can-work-without-include-directories-opencv-include-dirs/18740)

<div class="topic-metadata">

**Author:** [@Sea\_Sea](https://forum.opencv.org/u/Sea_Sea)\
**Replies:** 0\
**Last updated:** [September 13, 2024, 1:31am UTC](https://forum.opencv.org/t/it-can-work-without-include-directories-opencv-include-dirs/18740 "2024-09-13T01:31:12Z")

</div>

I comment include\_directories and it also can work. why? https://docs.opencv.org/4.x/db/df5/tutorial\_linux\_gcc\_cmake.html cmake\_minimum\_required(VERSION 2.8) project( DisplayImage ) find\_package( OpenCV REQUIRED ) # i…

---

## [Jetson Orin Nano, Build Error in OpenCV with Cuda(no to yes)](https://forum.opencv.org/t/jetson-orin-nano-build-error-in-opencv-with-cuda-no-to-yes/18593)

<div class="topic-metadata">

**Author:** [@honh1](https://forum.opencv.org/u/honh1)\
**Replies:** 6\
**Last updated:** [August 28, 2024, 8:49am UTC](https://forum.opencv.org/t/jetson-orin-nano-build-error-in-opencv-with-cuda-no-to-yes/18593 "2024-08-28T08:49:51Z")

</div>

Hello~ i want to build OpenCV with Cuda, and then first i do is to change jtop’s open cv with cuda NO -\>yes. this is my jtop, and i watched “https://www.youtube.com/watch?v=art0-99fFa8&t=86s” this video, and tryng… b…

---

## [Unable to build opencv 4.5 with FFmpeg](https://forum.opencv.org/t/unable-to-build-opencv-4-5-with-ffmpeg/9182)

<div class="topic-metadata">

**Author:** [@Ishan\_Bhatnagar](https://forum.opencv.org/u/Ishan_Bhatnagar)\
**Replies:** 11\
**Last updated:** [June 23, 2022, 7:22am UTC](https://forum.opencv.org/t/unable-to-build-opencv-4-5-with-ffmpeg/9182 "2022-06-23T07:22:13Z")

</div>

I am unable to build Opencv 4.5.5 with FFMPEG , Please find below error file. Error File

---

## [Errors while building a cmake c++ project that includes opencv library from vcpkg](https://forum.opencv.org/t/errors-while-building-a-cmake-c-project-that-includes-opencv-library-from-vcpkg/16537)

<div class="topic-metadata">

**Author:** [@Gokalp](https://forum.opencv.org/u/Gokalp)\
**Replies:** 5\
**Last updated:** [February 26, 2024, 9:30am UTC](https://forum.opencv.org/t/errors-while-building-a-cmake-c-project-that-includes-opencv-library-from-vcpkg/16537 "2024-02-26T09:30:28Z")

</div>

First of all, I am currently using Mingw-w64 version 13.2.0, cmake 3.28.3 and OpenCV version 4.8.0, Windows 10 and Visual Studio Code as the IDE. The project in question just has a main.cpp file in it whose sole purpose …

---

## [Ubuntu22.04 installing older OpenCV version](https://forum.opencv.org/t/ubuntu22-04-installing-older-opencv-version/16474)

<div class="topic-metadata">

**Author:** [@elniad](https://forum.opencv.org/u/elniad)\
**Replies:** 0\
**Last updated:** [February 15, 2024, 8:47pm UTC](https://forum.opencv.org/t/ubuntu22-04-installing-older-opencv-version/16474 "2024-02-15T20:47:06Z")

</div>

Hi all! I was trying to install OpenCV3.1.0 today, but I ran into a problem during the building process. I am using gcc-11 on Ubuntu22.04, so I thought there might be a problem with the compiler being too recent, becau…

---

## [Opencv build did not generate opencv\_world dll and only generates opencv\_videoio\_ffmpeg490\_64 (OpenCV with CUDA))](https://forum.opencv.org/t/opencv-build-did-not-generate-opencv-world-dll-and-only-generates-opencv-videoio-ffmpeg490-64-opencv-with-cuda/16397)

<div class="topic-metadata">

**Author:** [@fropatapon](https://forum.opencv.org/u/fropatapon)\
**Replies:** 7\
**Last updated:** [February 9, 2024, 2:44pm UTC](https://forum.opencv.org/t/opencv-build-did-not-generate-opencv-world-dll-and-only-generates-opencv-videoio-ffmpeg490-64-opencv-with-cuda/16397 "2024-02-09T14:44:18Z")

</div>

Hello! Its my first time trying to build opencv library and im experimenting the same error in Basically when i do the building process, the opencv\_worldXXX.dll isnt generated and I get an error when thying to built …

---

## [Making file error in old open cv version](https://forum.opencv.org/t/making-file-error-in-old-open-cv-version/16363)

<div class="topic-metadata">

**Author:** [@flukekit](https://forum.opencv.org/u/flukekit)\
**Replies:** 1\
**Last updated:** [February 5, 2024, 8:10am UTC](https://forum.opencv.org/t/making-file-error-in-old-open-cv-version/16363 "2024-02-05T08:10:13Z")

</div>

I try to install opencv 3.4.0 on Linux and get this error. How to fix it ? cmake -D CMAKE\_BUILD\_TYPE=RELEASE -D CMAKE\_INSTALL\_PREFIX=/usr/local -D WITH\_TBB=OFF -D WITH\_IPP=OFF -D WITH\_1394=OFF -D BUILD\_WITH\_D…

---

## [Can't build OpenCV with CUDA support](https://forum.opencv.org/t/cant-build-opencv-with-cuda-support/16079)

<div class="topic-metadata">

**Author:** [@Leonid\_Usyatinskiy](https://forum.opencv.org/u/Leonid_Usyatinskiy)\
**Replies:** 4\
**Last updated:** [January 8, 2024, 10:00am UTC](https://forum.opencv.org/t/cant-build-opencv-with-cuda-support/16079 "2024-01-08T10:00:53Z")

</div>

Made a lot of efforts with different parameters to build the OpenCV with CUDA support but everytime got the error: FAILED: bin/opencv\_world490.dll lib/opencv\_world490.lib C:\\windows\\system32\\cmd.exe /C “cd . && “C:\\Pr…

---

## [Trying to build older version of opencv with contrib for ios: Not possible?](https://forum.opencv.org/t/trying-to-build-older-version-of-opencv-with-contrib-for-ios-not-possible/15703)

<div class="topic-metadata">

**Author:** [@Azalin](https://forum.opencv.org/u/Azalin)\
**Replies:** 4\
**Last updated:** [December 1, 2023, 11:11am UTC](https://forum.opencv.org/t/trying-to-build-older-version-of-opencv-with-contrib-for-ios-not-possible/15703 "2023-12-01T11:11:11Z")

</div>

For iOS I’m trying to build an earlier version of opencv with contrib (4.2 to be exact) using this command: python3 opencv/platforms/ios/build\_framework.py ./contrib\_output --without objc --contrib opencv\_contrib --ipho…

---

## [Illegal instruction (core dumped) in cv::findHomography](https://forum.opencv.org/t/illegal-instruction-core-dumped-in-cv-findhomography/15015)

<div class="topic-metadata">

**Author:** [@Humam](https://forum.opencv.org/u/Humam)\
**Replies:** 1\
**Last updated:** [October 27, 2023, 9:19pm UTC](https://forum.opencv.org/t/illegal-instruction-core-dumped-in-cv-findhomography/15015 "2023-10-27T21:19:28Z")

</div>

I am getting this error: Illegal instruction (core dumped) When calling: cv::findHomography(query\_points, reference\_points, cv::RANSAC, homography\_ransac\_threshold\_, h\_mask); This happen only an AWS EC2 g5 machine wh…

---

## [Problem building OpenCV with CUDA support from source files with Cmake (Python)](https://forum.opencv.org/t/problem-building-opencv-with-cuda-support-from-source-files-with-cmake-python/14971)

<div class="topic-metadata">

**Author:** [@Eljais](https://forum.opencv.org/u/Eljais)\
**Replies:** 21\
**Last updated:** [October 27, 2023, 3:07pm UTC](https://forum.opencv.org/t/problem-building-opencv-with-cuda-support-from-source-files-with-cmake-python/14971 "2023-10-27T15:07:09Z")

</div>

Hello all, I am trying to compile OpenCV with Cuda support in Python, from source files using Cmake. I am using this video as reference: https://www.youtube.com/watch?v=YsmhKar8oOc However, after trying numerous times,…

---

## [Linking error with exit code 2 CMake opencv embarcadero C++ builder 10.3](https://forum.opencv.org/t/linking-error-with-exit-code-2-cmake-opencv-embarcadero-c-builder-10-3/13484)

<div class="topic-metadata">

**Author:** [@Xander-Vreeswijk](https://forum.opencv.org/u/Xander-Vreeswijk)\
**Replies:** 17\
**Last updated:** [September 29, 2023, 12:24pm UTC](https://forum.opencv.org/t/linking-error-with-exit-code-2-cmake-opencv-embarcadero-c-builder-10-3/13484 "2023-09-29T12:24:15Z")

</div>

I need to use OpenCV in embarcadero C++ builder 10.3 and to do that I use CMake and the following command to create the borland makefiles: cmake -DCMAKE\_C\_COMPILER=bcc32x.exe -DCMAKE\_CXX\_COMPILER=bcc32x.exe -DCMAKE\_CXX\_…

---

## [Some issue with cmake and opencv](https://forum.opencv.org/t/some-issue-with-cmake-and-opencv/8198)

<div class="topic-metadata">

**Author:** [@js0011003](https://forum.opencv.org/u/js0011003)\
**Replies:** 2\
**Last updated:** [November 18, 2022, 11:05am UTC](https://forum.opencv.org/t/some-issue-with-cmake-and-opencv/8198 "2022-11-18T11:05:17Z")

</div>

Detailed description recently i am working on my first project, which is using intel d455 to track skeleton. i am planning use opencv to complete. i had read some articles, and one of them is from intel. and this site l…

---

## [How to install relevant shared libraries along with executionable using cmake](https://forum.opencv.org/t/how-to-install-relevant-shared-libraries-along-with-executionable-using-cmake/6969)

<div class="topic-metadata">

**Author:** [@Peter\_Torrild](https://forum.opencv.org/u/Peter_Torrild)\
**Replies:** 12\
**Last updated:** [August 1, 2023, 7:33am UTC](https://forum.opencv.org/t/how-to-install-relevant-shared-libraries-along-with-executionable-using-cmake/6969 "2023-08-01T07:33:28Z")

</div>

Hi, i’m trying to build and install an executionable file that uses OpenCV. To build, install and package I use CMake and CPack. Here is my problem: In the cmake list, i have added the executionable, open cv is found a…

---

## [How to mitigate a version conflict in CMake](https://forum.opencv.org/t/how-to-mitigate-a-version-conflict-in-cmake/13986)

<div class="topic-metadata">

**Author:** [@Sam\_Tux](https://forum.opencv.org/u/Sam_Tux)\
**Replies:** 0\
**Last updated:** [July 21, 2023, 6:06pm UTC](https://forum.opencv.org/t/how-to-mitigate-a-version-conflict-in-cmake/13986 "2023-07-21T18:06:44Z")

</div>

.When I build OpenCV-dnn with CMake (along this lines: https://towardsdev.com/installing-opencv-4-with-cuda-in-ubuntu-20-04-fde6d6a0a367) at the stage of cmake command I get Could NOT find PythonLibs: Found unsuitable v…

---

## [Empty opencv\_core.lib file after running CMake for Embarcadero C++ Builder 10.3](https://forum.opencv.org/t/empty-opencv-core-lib-file-after-running-cmake-for-embarcadero-c-builder-10-3/13776)

<div class="topic-metadata">

**Author:** [@Xander-Vreeswijk](https://forum.opencv.org/u/Xander-Vreeswijk)\
**Replies:** 0\
**Last updated:** [July 6, 2023, 2:45pm UTC](https://forum.opencv.org/t/empty-opencv-core-lib-file-after-running-cmake-for-embarcadero-c-builder-10-3/13776 "2023-07-06T14:45:21Z")

</div>

I have been trying to create the necessary borland makefiles using CMake for embarcadero C++ builder. Till now I only succeeded in adding OpenCV 2.4.13 but that version is way too old so I want to try again and add OpenC…

---

## [Regarding setting flags while building opencv c++](https://forum.opencv.org/t/regarding-setting-flags-while-building-opencv-c/13333)

<div class="topic-metadata">

**Author:** [@opencvnoob](https://forum.opencv.org/u/opencvnoob)\
**Replies:** 4\
**Last updated:** [May 28, 2023, 7:19pm UTC](https://forum.opencv.org/t/regarding-setting-flags-while-building-opencv-c/13333 "2023-05-28T19:19:07Z")

</div>

So whenever we build opencv from source we end up setting the flag OPENCV\_ENABLE\_NONFREE=ON. Not doing this results in the dreaded error “xfeatures2d.hpp not found” or something similar to that. So my question how doe…

---

## [Inverse DFT slowdown with VS Cmake projects](https://forum.opencv.org/t/inverse-dft-slowdown-with-vs-cmake-projects/13274)

<div class="topic-metadata">

**Author:** [@arlysenko](https://forum.opencv.org/u/arlysenko)\
**Replies:** 11\
**Last updated:** [May 25, 2023, 4:19pm UTC](https://forum.opencv.org/t/inverse-dft-slowdown-with-vs-cmake-projects/13274 "2023-05-25T16:19:36Z")

</div>

Hello! I’ve created a c++ project with VS 2022. It worked fine. But when i switched it to VS Cmake project (recreated) noticed significant speed dropdown in a particular function call, namely, cv::dft(my\_input\_mat, my\_o…

---

## [Imshow() throws: The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support](https://forum.opencv.org/t/imshow-throws-the-function-is-not-implemented-rebuild-the-library-with-windows-gtk-2-x-or-cocoa-support/13259)

<div class="topic-metadata">

**Author:** [@patil\_dushyant](https://forum.opencv.org/u/patil_dushyant)\
**Replies:** 2\
**Last updated:** [May 21, 2023, 11:39pm UTC](https://forum.opencv.org/t/imshow-throws-the-function-is-not-implemented-rebuild-the-library-with-windows-gtk-2-x-or-cocoa-support/13259 "2023-05-21T23:39:45Z")

</div>

I have installed opencv from scratch and included opencv contrib to extra modules path. After this, I wrote basic script to read and show an image and compiled the code using cmake. The compilation was successful but wh…

[Next page](https://forum.opencv.org/tag/cmake/214.md?match_all_tags=true&page=1&tags%5B%5D=cmake)
