I am currently trying to compile a project in CMake 3.10.0 and it keeps giving the above error box and this
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CXX_COMPILER could be found.
Configuring incomplete, errors occurred!
See also "C:/build/CMakeFiles/CMakeOutput.log".
See also "C:/build/CMakeFiles/CMakeError.log".
I am currently running Microsoft Visual Studio 15 2017 and when I am configuring it, I am using x64.
asked Nov 22, 2017 at 20:01
i had same problem when using vs 2015 but after installing vs 2017 it solved. I think you should repair your visual studio 2017 and try again.
if cmake don`t let you configure with new vs in file tab clear use «delete cache» and try again
answered Aug 11, 2018 at 6:23
N.SN.S
1,32715 silver badges18 bronze badges
1
When you installed Visual Studio 2017, did you install the Visual C++ compilers? It’s not enabled by default. Go to Add or Remove programs and try Repairing/Modifying it to make sure Visual C++ is included.
This is going to sound like a stupid suggestion but if you’ve just installed VS 2017, make sure you’re actually able to compile a sample C++ solution. Yes, you would be surprised by the amount of people I’ve seen with this error that simply didn’t realize their compiler wasn’t installed.
My third suggestion would be to try opening the x86 or x64 Native Tools Command Prompt and try running your CMake build again. The problem, as I’m sure you’ve noticed haha, is that it can’t find your C compilers. Running these Command Prompts will ensure your correct environment variables are set. If this fails, your C compilers are missing and you need to re-install VS2017. If this works that means there’s an issue with your environment PATH.
answered Nov 22, 2017 at 21:01
![]()
ChrisChris
2,2047 silver badges22 bronze badges
8
First step, Click the File, select Delete Cache, Second step, Click the Configure, select the VS15 2017, then Done.



answered Mar 23, 2019 at 14:56
![]()
Fan YangFan Yang
5306 silver badges8 bronze badges
To Solve the problem, I just downloaded the last version of the opencv and opencv_contrib repositories(both on the same branch named ‘3.4’).
answered Apr 5, 2020 at 0:29
![]()
Another version of this error occurred in my case when I wanted to build librealsense from source using cmake, in my case the silly error was providing the source code path in librealsense E:librealsense-2.49.0src rather i should have provided E:librealsense-2.49.0 alone. this worked for me.
answered Oct 12, 2021 at 12:11
MadosMados
438 bronze badges
In my case, I hadn’t selected the correct visual studio version in the configuration panel. Once I did that everything worked correctly.
answered Jun 22, 2022 at 3:30
JesseJesse
311 silver badge4 bronze badges
Make sure that you named CMakeLists.txt correctly. Once I omitted a ‘s’ at the end of the list, so I got the same error. But when I added ‘s’ it worked well.
desertnaut
55.9k21 gold badges133 silver badges163 bronze badges
answered Aug 23, 2022 at 12:40
![]()
In addition to checking if I can compile a C++ program and rechecking my Visual Studio components, updating my windows SDK to the new version, I installed a another version of Cmake and it worked.
answered Oct 21, 2022 at 13:19
![]()
Caveat: This perhaps too obvious and facile to even post, but since @N.S’s answer made me think to try it, and it worked…
MacOS only: (using 13.1)
- Problem: Outdated version of CMake not used for a long time causing this error. Has been impossible to fix.
- Solution: Downloaded newest CMake, replacing outdated CMake. Working.
Xcode 14.2
answered Jan 1 at 21:32
![]()
Mote ZartMote Zart
8233 gold badges14 silver badges32 bronze badges
It is very strange that following the installation steps of others, there is a problem, (OK, actually I was in the process of installation, I was typing, I don’t know, press the wrong button)

You can check for specific errors in Cmake:

Boost_root is an environment variable that should be used in the process of installing BOOSTPRO. The BOOST_ROOT is an environment variable that should be used in the process of installing BOOSTPRO. The BOOST_ROOT is an environment variable. I added myself to this file

//Configure CMake// Configure

Reference:
【 1 】 http://boostpro.com/download/boost_1_47_setup.exe
【 2 】 Cmake always find a Boost libraries at http://stackoverflow.com/questions/19303430/cmake-cannot-find-boost-libraries
[3] solution: CMake compile time appear the error in the configuration process project files may be invalid at http://blog.sina.com.cn/s/blog_a2d9d5c60100y1at.html
Read More:
- Problems in compiling VTK with cmake: solutions to error configuration process, project files may be invalid
- “Error in configuration process project files may be invalid” appears during cmake compilation
- Solution: when cmake is compiled, “error in configuration process project files may be invalid” appears
- To solve problems in cmake VTK: error configuration process, project files may be invalid
- windows CMake error: error in configuration process, project files may be invalid
- Error in configuration process, project files may be invalid in cmake compilation
- Error resolution-“Error in configuration process, project files may be invalid” appears when Cmake compiles openCV
- When cmake is compiled, “error in configuration process project files may be invalid” appears
- Error configuration process and project file may be invalid appear in cmake compilation
- To solve the problem in Windows opencv installation: error configuration process, project files may be invalid
- Error configuration process, project files may be invalid
- Project files may be invalid appears when cmake compiles opencv3.1, and the debug additional dependency of the compiled opencv3.1 is at the end
- CMake Error at CMakeLists.txt:5 (PROJECT): The CMAKE_C_COMPILER: cl is not a full path
- Brief introduction of cmake generating all in vs Project_ BUILD、INSTALL、ZERO_ Check function!!
- JOM error 2 problem when qtcreator uses cmake to build a project
- [actual record of Android stepping on the pit] Android studio reports an error invalid gradle JDK configuration found after importing the project
- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:11 (project):
- gazebo7 CMake Error:Could not find a package configuration file provided by “gazebo_plugins“
- The requested page cannot be accessed because the related configuration data for the page is invalid
- CodeBlocks OpenGL configuration process
Hello,
I am trying to make on windows using cmake GUI, making for visual studio 2010, and I keep getting the the message «error in configuration process, project files may be invalid», please find the log below:
— Graphic backend is Ogre-1.9a
mobile rtshader
Add to your PATH: D:/Gamkit2/gamekit-master/Dependencies/Win32/gles2/bin
Looking for DirectX9…
Could not locate DirectX9
Looking for DirectX…
Could not locate DirectX
Looking for DirectX11…
Could not locate DirectX11
— The following external packages were located on your system.
— This installation will have the extra features provided by these packages.
- OpenGLES
- OpenGLES2
+ OpenGLES2
— The following OPTIONAL packages could NOT be located on your system.
— Consider installing them to enable more features from this software.
- DirectX: Support for the DirectX9 render system http://msdn.microsoft.com/en-us/directx/
- DirectInput/XInput: Support for the DirectInput/XInput http://msdn.microsoft.com/en-us/directx/
+ DirectX11: Support for the DirectX11 render system http://msdn.microsoft.com/en-us/directx/
DEP_INCLUDES: D:/Gamkit2/gamekit-master/Dependencies/Source/FreeType/include;D:/Gamkit2/gamekit-master/Dependencies/Source/FreeImage/ZLib;D:/Gamkit2/gamekit-master/Dependencies/Source/OIS/include;D:/Gamkit2/gamekit-master/Dependencies/Source/GameKit/Utils;D:/Gamkit2/gamekit-master/Dependencies/Source/GameKit/AnimKit;D:/Gamkit2/gamekit-master/Tools/FileTools/File;D:/Gamkit2/gamekit-master/Tools/FileTools/FileFormats/Blend
CMake Error at CMakeLists.txt:175 (file):
file COPY cannot find «D:/Developer/Installs/gamkit/systemlibs».
Looking for Cg…
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Could not locate Cg
Configuring OGRE 1.9.0
Creating Unity build files for target OgreMain
D:/Developer/Installs/gamkit/OgreMain/compile_OgreMain_0.cpp is up to date.
D:/Developer/Installs/gamkit/OgreMain/compile_OgreMain_1.cpp is up to date.
D:/Developer/Installs/gamkit/OgreMain/compile_OgreMain_2.cpp is up to date.
D:/Developer/Installs/gamkit/OgreMain/compile_OgreMain_3.cpp is up to date.
D:/Developer/Installs/gamkit/OgreMain/compile_OgreMain_4.cpp is up to date.
Creating Unity build files for target RenderSystem_GLES2
D:/Developer/Installs/gamkit/RenderSystem_GLES2/compile_RenderSystem_GLES2_0.cpp is up to date.
D:/Developer/Installs/gamkit/RenderSystem_GLES2/compile_RenderSystem_GLES2_1.cpp is up to date.
Creating Unity build files for target Plugin_ParticleFX
D:/Developer/Installs/gamkit/Plugin_ParticleFX/compile_Plugin_ParticleFX_0.cpp is up to date.
Creating Unity build files for target OgreRTShaderSystem
D:/Developer/Installs/gamkit/OgreRTShaderSystem/compile_OgreRTShaderSystem_0.cpp is up to date.
Creating Unity build files for target OgreOverlay
D:/Developer/Installs/gamkit/OgreOverlay/compile_OgreOverlay_0.cpp is up to date.
OGREKIT_OGRE_LIBS: OgreMain;OgreOverlay;FreeImage;freetype;GameKitUtils;OIS;ZLib;AnimKit;fbtFile;bfBlend;OgreRTShaderSystem;D:/Gamkit2/gamekit-master/Dependencies/Android/OpenAL/bin/armeabi-v7a/libopenal.so;OggVorbis;Lua;ZZipLib
Creating Unity build files for target OgreKitCore
D:/Developer/Installs/gamkit/Bin/OgreKitCore/compile_OgreKitCore_0.cpp is up to date.
D:/Developer/Installs/gamkit/Bin/OgreKitCore/compile_OgreKitCore_1.cpp is up to date.
D:/Developer/Installs/gamkit/Bin/OgreKitCore/compile_OgreKitCore_2.cpp is up to date.
D:/Developer/Installs/gamkit/Bin/OgreKitCore/compile_OgreKitCore_3.cpp is up to date.
D:/Developer/Installs/gamkit/Bin/OgreKitCore/compile_OgreKitCore_4.cpp is up to date.
zlib target:ZLib
CMake Error at Samples/AndroidDemo/Shared/CMakeLists.txt:36 (if):
if given arguments:
Unknown arguments specified
CMake Warning (dev) in Samples/OgreDemo/CMakeLists.txt:
Syntax Warning in cmake code at
D:/Gamkit2/gamekit-master/Samples/OgreDemo/CMakeLists.txt:53:23
Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
See also «D:/Developer/Installs/gamkit/CMakeFiles/CMakeOutput.log».
Re: Установка OpenCV
Letis » 11 мар 2016, 17:39
Итак. Я его победил. Необходимо было в CMake поставить галочку Agvanced и в появившемся пункте CMAKE_MAKE_PROGRAM прописать путь к mingw32-make.exe. Потом правда он ругался на отсутствие .dll и пришлось временно прописать папку bin компилятора в PATH (вероятно не редактируя PATH можно, если запустить cmake-gui через Qt-шную консоль). Далее все пошло по плану.
Теперь возникло ещё несколько вопросов. В той папке куда все собралось есть папки bin, lib и include. Вполне ожидаемо в bin лежат .dll, в lib лежат .a (тут я рассчитывал увидеть .lib но интернет говорит что это тоже статические библиотеки), а вот в include почему то ни чего кроме .cmake. Есть ещё папка install где есть свои bin, lib и include и там те-же самые .dll и .a (только в меньших количествах) в include всё-таки лежат долгожданные .h и .hpp. Вот первые вопросы. Такая странная организация это просто особенности работы CMake и/или MinGW? Я прав когда решил что главнее то что в install и в проекте прописывал пути именно туда? Может всё остальное, кроме папки install, вообще можно поудалять?
Тестовые программки работают НО просят .dll даже когда я в проекте указываю только пути к .a файлам. Я как-бы ожидал что статические библиотеки будут и линковаться соответственно статически. Эти самые .a-файлы заметно меньше весят нежели их .dll-братья с теми же названиями и подозрительно называются по шаблоку libopencv_%название%310.dll.a. Я прав предполагая что .a не настоящие статические библиотеки а что-то типа ссылок на .dll присутствующие там вероятно ради совместимости с C(без плюсов)?
Home
>
Programming
>
Detail page
Today, I want to configure Qt and OpenCV development environment, always encounter this error:
error in configuration process, project files may be invalid.
My environment:
win10+OpenCV3.1.0+Qt5.5+cmake3.4.0
The error as following:
Qt5Concurrent_DIR NOTFOUND
Qt5Core_DIR NOTFOUND
Qt5Gui_DIR NOTFOUND
Qt5OpenGL_DIR NOTFOUND
Solution:

Click the Add Entry button to add the value and the corresponding path
For example, my Qt5Core in the E:Qt.5mingw492_32libcmake directory, so that my error was successfully resolved!
Posted by Dikang Gu
in Programming
at May 05, 2017 — 5:12 AM
Tag:
cmake
OpenCV
Qt
Содержание
- OpenCV with QT – Installation, configuration, problems and solutions
- Published by Sanjaya on December 17, 2011 December 17, 2011
- 24 Comments
- Thilanka · December 17, 2011 at 11:08 pm
- Bandar · June 3, 2012 at 4:16 pm
- Sanjaya · June 3, 2012 at 8:26 pm
- Bandar · June 4, 2012 at 1:47 pm
- Sanjaya · June 4, 2012 at 2:06 pm
- Bandar · June 4, 2012 at 2:36 pm
- Sanjaya · June 4, 2012 at 2:55 pm
- Sanjaya · June 4, 2012 at 2:57 pm
- johnny · August 8, 2012 at 2:23 pm
- Maryam · August 31, 2012 at 9:28 am
- Sanjaya · August 31, 2012 at 10:38 am
- Maryam · September 1, 2012 at 1:20 pm
- Error compiling OpenCV — CMake #6132
- Comments
OpenCV with QT – Installation, configuration, problems and solutions
Published by Sanjaya on December 17, 2011 December 17, 2011
OpenCV ?
If you don’t know yet, OpenCV is a free library for image processing and computer vision applications. You can find more info from their web site.
So why QT ?
OpenCV can be used mainly in programs written in C and C++ (not only that, there are so many wrappers which enables you to work with OpenCV in other languages too). So talking about C++ why not using Visual C++ ?? Of course you can easily design GUIs. But why QT ?
QT is an C++ IDE which can be used to create gui applications easily. Find more info here.
The main advantage in using QT is that we can easily “integrate” the GUIs of OpenCV inside the GUIs created with QT.( Correct me if I’m wrong) What it means is that, It is hard to insert a video window inside a form created with C#. If you are using Visual Studio the window will open seperately to display the video. Think you got the point. Do some research, you’ll find the importance.
So let’s go to the topic..
Installing and configuring QT to work with OpenCV in Windows
Step 1:
FIrst we need to download and install the complete QT SDK. Download it here and get it installed. ( I have installed Qt SDK version 1.1.4 which includes the QT Creator IDE version 2.3 into the folder “C:\QtSDK”)
Step 2:
Install CMake. Download it here. (I used CMake 2.8.2)
Step 3:
Download OpenCV-2.2.0-win.zip and extract it to a folder (In my case it is C:\OpenCV2.2 ). I’m using the version 2.2 here. Newer versions also can be used in the same way i describe here with minor changes.
Step 4:
Now we need to comiple the OpenCV libraries. Run the CMake GUI.

Now give the source folder ( Mine is C:\OpenCV2.2) and create a folder for the binaries to be build (my case it is C:\OpenCV2.2MinGw ) and give the path to the “Where to build binaries” box.
Step 5:
Now press configure. Select the generator as MinGW Makefiles.
And select Use default native compilers and press finish.
Step 6:
Wait some time and you’ll get a configuration screen.
Set “DEBUG;RELEASE” for CMAKE_BUILD_TYPE.
If you like you can check the box for BUILD_EXAMPLES, so you can play with the examples 🙂
Now press configure again.
Step 7:
Now you’ll see a similar window to the last one and it asks for the path of qmake.exe. You need to puth the path to the qmake.exe here.
For me it is C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin\qmake.exe
Press configure again.
Step 8:
Now press Generate, so it will try to generate the makefiles.
“Missing libgmp-10.dll” problem
Most probably you’ll get a message saying that missing libgmp-10.dll is missing. Solution is simple just add the bin folder of MinGW to the System Path variable
( My Computer -> View System Information -> Advanced -> Environment Variables -> System Variables -> Path -. Edit (or New) )
In my case this path is C:\QtSDK\mingw\bin .
Now you are ready to proceed. Press generate button of the CMake window again.
Step 9:
Now you’ll get the required files in the folder which you gave as build folder above. Now we need to compile these files with MinGW.
Open Command Prompt and change your directory to the build folder
Now give the command mingw32-make
Have a nap because it takes some time for this process to complete 🙂
Step 10:
After completion of step 9 give the command mingw32-make install
Playing with QT : Check whether everything is working fine..
Download this. Double Click and open the Sanj.pro file. It will be opened with QT Creator.
In the Sanj.pro file change the paths “INCLUDEPATH” and “LIBS”, if you used paths other than the ones I used.
Now run the project. Enjoy using QT 🙂
Good books I have come across :
- For OpenCV with QT : OpenCV 2 Computer Vision Application Programming Cookbook book (Packt Publishers) (This is where I took the above simple example)
- For learning OpenCV : Learning OpenCV – O’Reilly Media
Thilanka · December 17, 2011 at 11:08 pm
Thanks for sharing your information with us. Keep up the good work and wish you all the best!
Bandar · June 3, 2012 at 4:16 pm
Thank dude so much.
I have a question. I just followed steps in this link
http://www.laganiere.name/opencvCookbook/chap1.shtml
It was nice and clear but I’ve got error
LNK1181: cannot open input file ‘opencv_core231.dll.lib’
Hopefully you help me
Sanjaya · June 3, 2012 at 8:26 pm
Please recheck the steps from the beginning to the end. Check whether the paths are set properly.
And you can try this. Add ‘opencv_core231.dll’ and/or ‘opencv_core231.lib’ to the bin folder of the project and try n see..
Bandar · June 4, 2012 at 1:47 pm
Thanks dude very much.
I did it but it didn’t work. Anyway, I wanna try your way then we’ll see.
Sincerely,
Sanjaya · June 4, 2012 at 2:06 pm
It’s the “debug” folder not “bin”. Or u can even put them in the project root as well.
However if it doesn’t work for you follow the above steps with OpenCV 2.2. It surely works..
Thank you for your interest and politeness 🙂
Bandar · June 4, 2012 at 2:36 pm
I’m using openCV 2.3.1 and I’m facing new problem with CMake is there any way to install openCV without using CMake.
I know how to install openCV on visual C++ without CMake, so I’m sure about QT ? If it didn’t work, it’s better to me to swithc to Matlab. this library’s driving me crazy.
Sanjaya · June 4, 2012 at 2:55 pm
What’s the error you are getting with cmake ?
File >> Delete cache and try again.
Sanjaya · June 4, 2012 at 2:57 pm
If you use pre-built binaries no need of using cmake. But for Mingw they don’t provide pre-built binaries I think..
johnny · August 8, 2012 at 2:23 pm
Thank you for this gold mine 🙂
Maryam · August 31, 2012 at 9:28 am
Hi,
Thank you for your detailed guide. I’m using OpenCV 2.4.4, and following your steps. In step 5 it’s giving me this error: “Error in configuration process,
project files may be invalid”
I get the following in the message area: ”
CMake Error: The source directory “C:/OpenCV2.4″ does not appear to contain CMakeLists.txt.
Specify –help for usage, or press the help button on the CMake GUI.”
Could you please help me figure it out?
Sanjaya · August 31, 2012 at 10:38 am
Hi,
I think the version is OpenCV 2.4.2 and you have downloaded OpenCV-2.4.2.exe from sourceforge.
I tried this using this OpenCV-2.4.2.exe file and it works fine for me. As I feel the problem is that OpenCV-2.4.2.exe may have created a folder named “opencv” in your “C:/OpenCV2.4” folder. Check whether CMakeLists.txt file exists in “C:/OpenCV2.4/opencv”. If so you can give that path for the source directory and it will work fine 🙂
Maryam · September 1, 2012 at 1:20 pm
Thanks a lot for your guidance, I’m getting another error message now in the message area =)
“CMake Error: CMake was unable to find a build program corresponding to “MinGW Makefiles”.”
as well as a list of missing variables:
CMAKE_CXX_COMPILER_ENV_VAR
CMAKE_CXX_COMPILER
CMAKE_C_COMPILER_ENV_VAR
CMAKE_C_COMPILER
Источник
Error compiling OpenCV — CMake #6132
I just moved to using 3.0 version of OpenCV. This error seems to follow me. I have treid cleaning the project, moving to 3.1, but I cant seem to figure out what I’m missing:
Any tips on tackling this will help. I am building OpenCV on OSX El Capitan. I am not sure if this is a problem with cmake or opencv. Envorinment variables seem to be correct. Thanks!
The text was updated successfully, but these errors were encountered:
What version of Microsoft Visual Studio is used . on MacOS?
This is wrong binary package .exe , it is for Windows with MSVS only.
You should build OpenCV from sources directly or via homebrew
That is what baffled me. I am in fact building from source.
- Build from scratch (clean build directory)
- Some example steps for MacOS build you can find here
I deleted the build directory and compiled again, but in vain. Also tried going down to 3.0.0, didn’t help.
could it be because somehow its looking in the wrong cmake config file?
Here it looks in the cmake folder, should it look for the cmake config in the build folder?
OpenCV_DIR can’t point to source directory: use build or install OpenCV path for your application only.
Also using of CMAKE_PREFIX_PATH is more preferable way to point OpenCV location. See here an example how to build apps with binary distribution of OpenCV
@vikrantvm @alalek
HI, I also have the same problem like you.
I think that you have your problem because you find the OpenCVConfig.cmake file in this path
Actually, you should
cmake -DOpenCV_DIR=/Applications/opencv-3.1.0/build/OpenCVConfig.cmake
So, you will find the OpenCVConfig.cmake file in the ../build path not the ../cmake path.
But my problem is even I cmake -DOpenCV_DIR=/Applications/opencv-3.1.0/build , it has error blow.
CMake Error at CMakeLists.txt:4(FIND_PACKAGE):
Found package configuration file:
/home/dear/opencv-3.0.0/build/OpenCVConfig.cmake(this is the build path in my ubuntu 14.04 computer)
but it set OpenCV_FOUND to FALSE so package «OpenCV» is considered to be NOT FOUND.
Thank U so much.
I am trying post the details of the ../build/OpenCVConfig.cmake file
Here is my ../build/OpenCVConfig.cmake file
https://github.com/HeGaoYuan/scene_classification/blob/master/OpenConfig.cmake
If you have similiar issues as the author of this issue there should be the question whether you are building opencv the correct way.
Actually i do not know what you are trying to do with this line:
cmake -DOpenCV_DIR=/Applications/opencv-3.1.0/build/OpenCVConfig.cmake
Building should be straight forward as it is with any cmake project.
- point to you source folder /opencv/
- create a new folder called build and change to that folder -> you are now in /opencv/build/
- run cmake .. to run cmake from your build folder using the /opencv/ folder just as is
@Dikay900
Thank you for your reply.
I am sorry that I type something wrong.
My exam project’s path is /home/dear/coding/exam2/exam2.cpp, then I go into the /home/dear/coding/exam2/build, then I type cmake .. -DOpenCV_DIR=/home/dear/opencv-3.0.0/build .
Then I got this error
CMake Error at CMakeLists.txt:4(FIND_PACKAGE):
Found package configuration file:
/home/dear/opencv-3.0.0/build/OpenCVConfig.cmake(this is the build path in my ubuntu 14.04 computer)
but it set OpenCV_FOUND to FALSE so package «OpenCV» is considered to be NOT FOUND.
How did you get it?
Ok so this seems to be a different problem since you have a problem using the compiled library in your own project (I suppose?). This Issue was a problem with compiling the opencv sources.
How does your own cmake file look like? When you use opencv as an external library there is a simple tutorial here: http://docs.opencv.org/3.1.0/db/df5/tutorial_linux_gcc_cmake.html#gsc.tab=0
@alalek
I get it from reading the book OpenCV By Example (the author is Prateek Joshi)

@Dikay900
Here is my cmake file in the /home/dear/coding/exam2/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0012 NEW)
PROJECT(project)
FIND_PACKAGE(OpenCV REQUIRED)
MESSAGE(«OpenCV version: $«)
include_directories($)
link_directories($)
SET(SRC exam2.cpp)
ADD_EXECUTABLE($ $)
TARGET_LINK_LIBRARIES($ $)
What is about CMAKE_INSTALL_PREFIX for OpenCV build?
Details of your case are required, book screenshots doesn’t help a lot.
Run your cmake command (for your file) with —trace option and try investigate problem.
sudo apt-get install libopencv-dev
Errata. It is not required
@alalek
Thank you for your help so much!
As the book screenshots shows, when I install OpenCV in my computer.
I go into the /home/dear/opencv-3.0.0/build, then I type this command
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/home/dear/opencv-3.0.0/build -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=/home/dear/opencv_contrib-3.0.0/modules ../
@alalek @Dikay900
Thank you again.
I will read the link given by you firstly, I think it will help me.
I also meet this issue.but I can’t solve it use thoes ways.What causes this problem?OpenCVConfig.cmake?or CMakeLIsts.txt?
Found package configuration file:
but it set OpenCV_FOUND to FALSE so package «OpenCV» is considered to be
NOT FOUND.
Anyone who gets this message (i.e. no problem on finding configuration file, but still error like above) may try my approach which is to set OpenCV_FOUND variable to 1 in your CMakeLists.txt like shown below.
Then, delete «CMakeCache.txt».
Finally,
@SaverioSun could you please elaborate what worked? I too am trying to debug this error of OpenCV_FOUND set to FALSE.
Thank you.
Hi @magiccjae — Could you please let me know where you found the CMakeLists.txt file?
In your CMakeLists.txt file, insert the code
set(OpenCV_DIR )
it worked for me
@xiao333ma thank you, I will try that. And where exactly would the CMakeLists.txt file be present?
from opencv/build/ copy OpencvConfig.cmake and OpenCVModules.cmake to opencv/cmake/
then in you project delete file build and run again cmake .. and make
@absnaik810 Sorry for late 😁 , I bulid KAZE, there is a CMakeLists.txt in the folder, and i have a opencv source folder, i add the code in my kaze/CMakeLists.txt .
I get the following error. I have tried the «set(OpenCV_DIR )» and set(OpenCV_FOUND 1)
I solved the problem by changing the directory:
From: «C:/opencv/opencv320/build»
To: «C:/opencv/opencv320/build/x64/vc14/lib»
From: SET(«OpenCV_DIR» «C:/opencv/opencv320/build»)
To: SET(«OpenCV_DIR» «C:/opencv/opencv320/build/x64/vc14/lib»)
It was to compile the fDSST Tracker
I had the same problem,then it works.
Hey. I’am trying to compile the OpenCV 4.1.0 for 32bit architecture using the CMake and the QT5.6 . I have been followed this tutorial on youtube: https://www.youtube.com/watch?v=7zYJFjqPklI After all the configurations i’am getting this error:
libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.1.0-libjpeg-turbo
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
Could NOT find BLAS (missing: BLAS_LIBRARIES)
LAPACK requires BLAS
A library with LAPACK API not found. Please specify library location.
Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
**> C:/opencv-4.1.0/modules/calib3d
C:/opencv-4.1.0/modules/core
C:/opencv-4.1.0/modules/dnn
C:/opencv-4.1.0/modules/features2d
C:/opencv-4.1.0/modules/flann
C:/opencv-4.1.0/modules/gapi
C:/opencv-4.1.0/modules/highgui
C:/opencv-4.1.0/modules/imgcodecs
C:/opencv-4.1.0/modules/imgproc
C:/opencv-4.1.0/modules/java
C:/opencv-4.1.0/modules/js
C:/opencv-4.1.0/modules/ml
C:/opencv-4.1.0/modules/objdetect
C:/opencv-4.1.0/modules/photo
C:/opencv-4.1.0/modules/python
C:/opencv-4.1.0/modules/stitching
C:/opencv-4.1.0/modules/ts
C:/opencv-4.1.0/modules/video
C:/opencv-4.1.0/modules/videoio
C:/opencv-4.1.0/modules/world
C:/opencv-4.1.0/modules/calib3d
C:/opencv-4.1.0/modules/core
C:/opencv-4.1.0/modules/dnn
C:/opencv-4.1.0/modules/features2d
C:/opencv-4.1.0/modules/flann
C:/opencv-4.1.0/modules/gapi
C:/opencv-4.1.0/modules/highgui
C:/opencv-4.1.0/modules/imgcodecs
C:/opencv-4.1.0/modules/imgproc
C:/opencv-4.1.0/modules/java
C:/opencv-4.1.0/modules/js
C:/opencv-4.1.0/modules/ml
C:/opencv-4.1.0/modules/objdetect
C:/opencv-4.1.0/modules/photo
C:/opencv-4.1.0/modules/python
C:/opencv-4.1.0/modules/stitching
C:/opencv-4.1.0/modules/ts
C:/opencv-4.1.0/modules/video
C:/opencv-4.1.0/modules/videoio
C:/opencv-4.1.0/modules/world
CMake Error at cmake/OpenCVModule.cmake:354 (message):
Duplicated modules LOCATIONS has been found
Call Stack (most recent call first):
cmake/OpenCVModule.cmake:371 (_assert_uniqueness)
modules/CMakeLists.txt:7 (ocv_glob_modules)**
Configuring incomplete, errors occurred!
See also «C:/opencv-4.1.0/release/CMakeFiles/CMakeOutput.log».
Do you know what is happening?
If you have similiar issues as the author of this issue there should be the question whether you are building opencv the correct way.
Actually i do not know what you are trying to do with this line:
cmake -DOpenCV_DIR=/Applications/opencv-3.1.0/build/OpenCVConfig.cmake
Building should be straight forward as it is with any cmake project.
- point to you source folder /opencv/
- create a new folder called build and change to that folder -> you are now in /opencv/build/
- run cmake .. to run cmake from your build folder using the /opencv/ folder just as is
Yes doing it preatty right from this page my friend. Poor documentation is what happens http://openbiometrics.org/docs/install/#linux
Hey. I’am trying to compile the OpenCV 4.1.0 for 32bit architecture using the CMake and the QT5.6 . I have been followed this tutorial on youtube: https://www.youtube.com/watch?v=7zYJFjqPklI After all the configurations i’am getting this error:
libjpeg-turbo: VERSION = 2.0.2, BUILD = opencv-4.1.0-libjpeg-turbo
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
Could NOT find BLAS (missing: BLAS_LIBRARIES)
LAPACK requires BLAS
A library with LAPACK API not found. Please specify library location.
Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
**> C:/opencv-4.1.0/modules/calib3d
C:/opencv-4.1.0/modules/core
C:/opencv-4.1.0/modules/dnn
C:/opencv-4.1.0/modules/features2d
C:/opencv-4.1.0/modules/flann
C:/opencv-4.1.0/modules/gapi
C:/opencv-4.1.0/modules/highgui
C:/opencv-4.1.0/modules/imgcodecs
C:/opencv-4.1.0/modules/imgproc
C:/opencv-4.1.0/modules/java
C:/opencv-4.1.0/modules/js
C:/opencv-4.1.0/modules/ml
C:/opencv-4.1.0/modules/objdetect
C:/opencv-4.1.0/modules/photo
C:/opencv-4.1.0/modules/python
C:/opencv-4.1.0/modules/stitching
C:/opencv-4.1.0/modules/ts
C:/opencv-4.1.0/modules/video
C:/opencv-4.1.0/modules/videoio
C:/opencv-4.1.0/modules/world
C:/opencv-4.1.0/modules/calib3d
C:/opencv-4.1.0/modules/core
C:/opencv-4.1.0/modules/dnn
C:/opencv-4.1.0/modules/features2d
C:/opencv-4.1.0/modules/flann
C:/opencv-4.1.0/modules/gapi
C:/opencv-4.1.0/modules/highgui
C:/opencv-4.1.0/modules/imgcodecs
C:/opencv-4.1.0/modules/imgproc
C:/opencv-4.1.0/modules/java
C:/opencv-4.1.0/modules/js
C:/opencv-4.1.0/modules/ml
C:/opencv-4.1.0/modules/objdetect
C:/opencv-4.1.0/modules/photo
C:/opencv-4.1.0/modules/python
C:/opencv-4.1.0/modules/stitching
C:/opencv-4.1.0/modules/ts
C:/opencv-4.1.0/modules/video
C:/opencv-4.1.0/modules/videoio
C:/opencv-4.1.0/modules/world
CMake Error at cmake/OpenCVModule.cmake:354 (message):
Duplicated modules LOCATIONS has been found
Call Stack (most recent call first):
cmake/OpenCVModule.cmake:371 (_assert_uniqueness)
modules/CMakeLists.txt:7 (ocv_glob_modules)**
Configuring incomplete, errors occurred!
See also «C:/opencv-4.1.0/release/CMakeFiles/CMakeOutput.log».
Do you know what is happening?
This is because you put the «modules» together both opencv and openc_contrib
Make the source code tree as this:
$ ls
opencv-4.1.0 opencv_contrib-4.1.0
Источник
Dear ALL,
The purpose of my project is to use opencv in CODEBLOCKS for face identification.
The tools I am using:
Windows 10 professional french version 64 bits
CodeBlocks-16.01 mingw setup.exe
Opencv 2.4.13
CMake 3.8.2 -win64
The Cmake configuration generated the following errors.
I am grateful for any help to move forward.
Thank you in advance for your assistance.
Best Regards
C:fakepathCMake settings.png C:fakepathCMake error.png
CMake Warning at C:/Program Files (x86)/CMake/share/cmake-3.8/Modules/Platform/Windows-GNU.cmake:196 (message):
Disabling CMAKE_GNUtoMS option because CMAKE_GNUtoMS_VCVARS is not set.
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.8/Modules/Platform/Windows-GNU-CXX-ABI.cmake:1 (__windows_compiler_gnu_abi)
C:/Program Files (x86)/CMake/share/cmake-3.8/Modules/CMakeCXXInformation.cmake:70 (include)
CMakeLists.txt:68 (project)
Detected version of GNU GCC: 49 (409)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Core", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5Core" with any
of the following names:
Qt5CoreConfig.cmake
qt5core-config.cmake
Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
"Qt5Core_DIR" to a directory containing one of the above files. If
"Qt5Core" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:487 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Gui", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5Gui" with any
of the following names:
Qt5GuiConfig.cmake
qt5gui-config.cmake
Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
"Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:487 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake
Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:487 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):
By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Test", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5Test" with any
of the following names:
Qt5TestConfig.cmake
qt5test-config ...
(more)
Question Tools
1 follower