WITH_WIN32UI in CMake does not create HAVE_WIN32UI (Bug #3116)
Description
Setting WITH_WIN32UI in CMake should result in a preprocessor flag named HAVE_WIN32UI, but somehow this does not happen with OpenCV 2.4.5 and Visual Studio 2010 under Windows 8.
See
http://answers.opencv.org/question/15765/cv_no_gui_error-thrown-on-windows-8/
for more details and a fix.
Associated revisions
Merge pull request #3116 from shubhra:master
History
Updated by Alexander Smorkalov over 11 years ago
- Assignee set to Alexander Smorkalov
Updated by Alexander Smorkalov over 11 years ago
WITH_WIN32UI cmake option enables standard Win32 API for GUI check (Window Management + GDI). Cmake tries to find them by building cmake/checks/win32uitest.cpp check. If build was not successful cmake turn off HAVE_WIN32UI flag. I check your issue on my virtual machine with Win8 and Visual Studio 2012 and buildbot builders (htpp://build.opencv.org) with Windows. All pass highgui tests and show windows. It means that HAVE_WIN32UI is setup properly.
Check your cmake output. Check, that you have string like this: "Win32 UI: YES". If it reports no then headers or libs are missing. Check, that you have Windows Platform SDK installed on your system.
- Status changed from New to Incomplete
Updated by be rak over 11 years ago
thanks for all that detailled info !
had the same problem on xp / vs2008 / opencv2.4.9
"cl cmake/checks/win32uitest.cpp user23.lib gdi32.lib"
compiled fine on the console, but try_compile in cmake always failed,
even if i removed all the code from the testprog and the CFLAG line with the libs.
same problem with vfwtest.cpp, btw.
so i started to suspect an issue with cmake itself, updated from 2.8.0 to 2.8.11.1, -
voila! problem solved.
Video for Windows: YES
Win32 UI: YES
Updated by Alexander Smorkalov over 11 years ago
- Status changed from Incomplete to Cancelled
Updated by Sebastian Krämer over 11 years ago
Hello. For me, the bug still persists :(
I'm using Windows7 64 bit and cmake-2.8.11.2. It errors out with:
CMake Error at cmake/OpenCVFindLibsGUI.cmake:8 (TRY_COMPILE): Failed to open /CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeLists.txt No such file or directory Call Stack (most recent call first): CMakeLists.txt:397 (include) CMake Error at cmake/OpenCVFindLibsVideo.cmake:7 (TRY_COMPILE): Failed to open /CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeLists.txt No such file or directory Call Stack (most recent call first): CMakeLists.txt:398 (include)
This happens with target VS2012 and VS2010 x64 configuration (the ones that are installed). I have to disable WITH_WIN32UI and WITH_VFW for it to being able to generate the project+solution files.
Using the same command line as be rak in a VS command prompt, win32uitest.cpp compiles successfully (same for vfwtest.cpp).
I tried opencv-2.4.6 official download and the 2.4 git branch from yesterday.
- Target version changed from 2.4.6 to 2.4.7
- Status changed from Cancelled to Open
Updated by Alexander Smorkalov over 11 years ago
I cannot reproduce the issue in my virtual machine with Windows 8 MS Visual Studio 2012 and cmake 2.8.11.1. It looks like it was fixed by Roman's pull request https://github.com/Itseez/opencv/pull/1324/. I close the issue. Fill free to reopen it if you find and problems.
- Status changed from Open to Done
- Pull request set to https://github.com/Itseez/opencv/pull/1324
- Affected version changed from 2.4.5 (latest release) to 2.4.6 (latest release)
Updated by Sebastian Krämer over 11 years ago
Yes, it's fixed for me, too. Great!