aam-opencv build producing errors - c++

i am trying to build aam-opencv following the brief tutorial from the sources website here . I keep recieveing the error:
-- Configuring incomplete, errors occurred!
C:\aam-opencv\build>cmake ..
-- The C compiler identification is MSVC 17.0.61030.0
-- The CXX compiler identification is MSVC 17.0.61030.0
CMake Error at cmake/modules/FindOpenCV.cmake:239 (MESSAGE):
OpenCV required but some headers or libs not found. Please specify it's
location with OpenCV_ROOT_DIR env. variable.
Call Stack (most recent call first):
CMakeLists.txt:48 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
I have tried using the variable OpenCV_ROOT_DIR="c:\opencv-2.4.9\opencv\build, but that also produced the same error.
Any help would be much appreciated!

I hope someone else will find my answer helpful. After about a week of searching I came across a brief tutorial online. Doing this made it possible. (Although getting the application to run, requires some debugging to let it work with windows)
If you want to without cygwin but with Visual C++, you need following:
1) CMake 2.6 or later
2) OpenCV Ver 1.0 <- The OpenCV Version is Crucial in this tutorial
3) Qt 2.6.1 or later
1) CMake
download cmake from http://www.cmake.org/files/v2.8/cmake-2.8.2-win32-x86.exe
install with default option
2) OpenCV ver. 1.0
download from http://sourceforge.net/projects/opencvlibrary/files/opencv-win/1.0/OpenCV_1.0.exe/download
install with default option.
3) Qt 4.6.3
download Qt for Open Source C++ development on Windows (VS2008) from http://qt.nokia.com/downloads/windows-cpp-vs2008
Build:
set System Environment variable OpenCV_ROOT_DIR to C:\Program Files\OpenCV
Download aam-opencv.rar from attached to this article.
Extract aam-opencv.rar to somewhere you want (e.g. D:\Project \aam)
Open D:\Project\aam\aam-opencv\src\opencvWebcam.cpp
modify line 51
If you want to use movie file, specify your movie file path.
Note that you have to specify path using \ as path separator.
If you want to use webcam, comment line 51 and uncomment line 52.
run CMake gui
Select for "D:\Project\aam\aam-opencv" as "Where is the source folder" option
Select for "D:\Project\aam\aam-opencv\build" as "Where to build the binaries" option
Click "Configure" button
Then, You will see generator option.
Select "Visual Studio 9 2008"
if needed,select C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe as c compiler and cxx compiler.
Click "Generate" button.
Then, You can see D:\Project\aam\aam-opencv\build\AAM.sln
Open D:\Project\aam\aam-opencv\build\AAM.sln with your Visual C++
Build Solution.
Congratulations!
Now you can run q-aamtrainer.exe from VC ++ menu, select Debug -> Start Debugging by selecting D:\Project\aam\aam-opencv\build\Debug\qt-aamtrainer.exe
NOTE: After I complete debugging and get this application working i will link or update to my answer, keep posted!
UPDATE I was not able to get it to run on windows, if anyone has a solution, comment or link to the answer.

Related

Error in configuration process project files may be invalid

i get this error using cmake Version 3.11.2 on Windows 10 with visual Studio 14 2015 created Project. I already used cmake on the same Project on Windows 7 but in Windows 10 it doesnt seem to work.
Selecting Windows SDK version to target Windows 10.0.17134.
CMake Error at C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/Compiler/._ADSP-DetermineCompiler.cmake:1:
Parse error. Expected a command name, got bad character with text "".
Call Stack (most recent call first):
C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeCompilerIdDetection.cmake:6 (include)
C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeCompilerIdDetection.cmake:32 (_readFile)
C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCompilerId.cmake:128 (compiler_id_detection)
C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCompilerId.cmake:147 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCompilerId.cmake:31 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
C:/Users/Ali/Desktop/cmake-3.11.2-win64-x64/share/cmake-3.11/Modules/CMakeDetermineCCompiler.cmake:112 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt
Configuring incomplete, errors occurred!
See also "C:/Users/Ali/Desktop/Projekt1/build/CMakeFiles/CMakeOutput.log".
In the logfile there is nothing useful.Just :The system is: Windows - 10.0.17134 - AMD64
I already checked all other threads on stackoverflow but couldnt find a solution.
Does anyone had the same error or does know what to do to fix it ?
Under Modules/Compiler/ there shouldn't be files started with ._. Probably, you got them when copy CMake from external drive, which has such files as hidden ones. E.g. from MacOS.
Either remove files started with ._, or repeat copying of CMake without them.
Thanks to #Tsyvarev's answer! I had never heard of macOS filesystem metadata causing problems.
If you take cmake files on macOS and tar it you'll get this. One solution is to use --disable-copyfile when you compress it to avoid these files:
tar --disable-copyfile -czf cmake-3.19.6-rh6.tgz ./cmake-3.19.6-rh6/

Build OpenCV for UWP

I'm currently struggling to build OpenCV for the UWP.
I already googled quite a lot and found Microsoft's OpenCV Github Repo which tecnically should do the magic. However, this repo and pretty much everything else I found in this regard are outdated (Visual Studio 2015, old OpenCV versions etc.). I need to use OpenCV 3.3 because it's a cross platform project and I don't want to recompile everything else solely because of an outdated git repo.
Can anyone explain the process of building OpenCV using CMake from the official repo for the UWP?
My first attempt was to simply use the Windows Dlls, however my application than shouts "Failed to load module" at me. Then, I tried to build OpenCV the Visual Studio Project files as stated here and here. However, this doesn't do it for me as it throws the following error:
CMake Error at cmake/OpenCVUtils.cmake:440 (if):
if given arguments:
"(" "OR" "OFF" ")"
Unknown arguments specified
Call Stack (most recent call first):
CMakeLists.txt:317 (OCV_OPTION)
It also tells me to check the CMakeOutput.log but there it's 0 errors everywhere.
If someone could tell me either how to get rid of this error or what to change in the CMake GUI to build OpenCV for UWP, that'd be great!
Edit:
I also tried to compile OpenCV with a platform specific toolchain for WinRT as found in platforms/winrt. It doesn't really change anything though (I'm not even sure if it should), I still get "Unable to load Dll: The specified module could not be found". Maybe GPPK is right in his assumption that it's more an UWP problem than an OpenCV one. Anyways, if anyone knows anything about this, I'd really love to get some help!
Ok, I didn't get an answer yet, so I managed to do it myself (more or less).
Here's how I did it:
Prerequisites
Visual Studio (2017)
UWP SDK
CMake
OpenCV from official repo
Steps
Create a build folder which you want the UWP libraries to built in.
Start PowerShell in this folder and execute the following command (exchange C:\OpenCV with your local OpenCV path): cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERS
ION="10.0" -DCMAKE_VS_EFFECTIVE_PLATFORMS=x86 -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF C:\OpenCV
If you get the same error message as I did (see question for more details), go to the root CMakeLists.txt in the OpenCV folder and add a # in front of line 317 (OCV_OPTION(ENABLE_PYLINT)). This should fix it, to check, execute the command from above once more.
Ensure that the output claims "Windows RT support YES" and "Building for Microsoft platform: Windows".
Open OpenCV.sln in the build folder. Ensure that all projects are either of type "Windows Store" or "Universal Windows" and build the ALL_BUILD Project twice: Once in Release configuration, and once in Debug. Then build the INSTALL Project.
That's it, you should find the built Dlls in the install folder. Step 3 is probably a bug in OpenCV and will hopefully be fixed in upcoming versions.

cmake could not find SDK10

I have a problem with cmake after I installed a new SDK 10 version (now it should be 10.0.10586.0). But when I run cmake cmakelists.txt, I got this error message:
-- Building for: Visual Studio 14 2015
-- 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.
I googled a while but could not find the right answer. My problem is that I can use VS2015 to build my application (old projects) using the new SDK. Everything seems to be fine. But cmake will try to build one small generated project (CompilerIdCXX.vcxproj). But in this project, SDK 8 is used (which is not available in my system anymore).
Could you help me, many thanks in advance
Problem solved (sorta of), I have to reinstall an older version of SDK10 aside from the version 10.0.10586.0. It is weird that uninstalling the older version had somehow damaged the environment.

Installing the SFGUI with Cmake

I've been trying to install SFGUI library with Cmake tool with instructions given here: SFGUI Install Tutorial . Still got many problems in major with Cmake, which couldn't find few files from SFGUI directory, for example
CMake Error: The source "D:/SFGUI-master/CMakeLists.txt" does not match the source "D:/SFGUI-0.3.0/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
Restarting didn't help. Could anyone write how to install this in simple steps? Regards.
cmake is telling you that the files it has generated in it's cache from a previous run don't match the source files you are currently using. I would imagine that you ran cmake, then switched git branches or tags and tried to run cmake again. You can just rm -r CMakeFiles in your build directory to remove the cache. Then you should be able to run cmake again without errors.
Thanks! It moved a little bit, but stopped actually at error:
CMake Error at cmake/Modules/FindSFML.cmake:306 (message):
Could NOT find SFML (missing: SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY
SFML_SYSTEM_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:21 (find_package)
Configuring incomplete, errors occurred!
See also "C:/Users/admin/Documents/Visual Studio 2015/Projects/sfml1/sfml1/CMakeFiles/CMakeOutput.log".
To be honest, I will write down steps I did: 1.Configured SFML in VS15 in Windows 8.1 2. I installed the newswet version of CMake 3. Installed also newest SFGUI from Github. 4.In Cmake GUI as a build I choose my project in VS and as a source - SFGUI directory. 5.In CMake Configure and there are the errors. Did I missed something?

CMake error for OpenCV compilation in Windows

I am trying to build the files in the "Source" folder to the "Build" folder using CMake in order to build OpenCV program in Eclipse. But I am facing the following error:
The C++ compiler "C:/MinGW/bin/g++.exe" is not able to compile a simple
test program. It fails with the following output:
Change Dir: C:/opencv/mbuild/CMakeFiles/CMakeTmp
Run Build Command:"C:/CMake/bin/cmake.exe" "cmTC_03910/fast"
CMake Error: The source directory
"C:/opencv/mbuild/CMakeFiles/CMakeTmp/cmTC_03910/fast" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
I have installed MinGW several times along with CMake also, but still getting the same error.
Please help me out!! Thanks in advance
As mentioned at this tutorial PyIMageSearch opencv install
if you are using opencv version 3.1 you should set
-D INSTALL_C_EXAMPLES=OFF \ instead ON
I solved problem with this way