PDA

View Full Version : CMake fails on Windows 7 64-bit



IndigoJo
4th September 2011, 17:13
Hi everyone,

I recently upgraded to Windows 7 and decided to use the 64-bit version (I had previously been using 32-bit Vista). I've been developing using Qt 4 with MinGW and CMake. However, when I tried running CMake on my project, it failed to run a test compile and aborted. This was the output:


-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: C:/QtSDK/mingw/bin/gcc.exe
-- Check for working C compiler: C:/QtSDK/mingw/bin/gcc.exe -- broken
CMake Error at C:/Program Files x86/CMake 2.8/share/cmake-2.8/Modules/CMakeTestC
Compiler.cmake:52 (MESSAGE):
The C compiler "C:/QtSDK/mingw/bin/gcc.exe" is not able to compile a simple
test program.

It fails with the following output:

Change Dir: C:/Users/Yusuf Smith/hg/qtm-1.4/CMakeFiles/CMakeTmp



Run Build Command:C:/QtSDK/mingw/bin/mingw32-make.exe
"cmTryCompileExec/fast"

C:/QtSDK/mingw/bin/mingw32-make.exe -f
CMakeFiles\cmTryCompileExec.dir\build.make
CMakeFiles/cmTryCompileExec.dir/build

C:/QtSDK/mingw/bin/mingw32-make.exe: Interrupt/Exception caught (code =
0xc0000005, addr = 0x41f96e)





CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)


-- Configuring incomplete, errors occurred!

I have seen in some places the solution of making sure there are no parentheses in the PATH (such as "Program Files (x86)" which is found on most 64-bit Windows installations). Although this exists on my system, it's not in the PATH when running the Qt command prompt.

Any ideas?

ChrisW67
5th September 2011, 00:00
Spaces in paths are often troublesome, but I don't think that's the issue here.

The error from mingw32-make is a general access violation (NULL pointer, invalid pointer access etc.) If you cannot run mingw32-make from the same command line as CMake then the problem is not CMake. Is your MingW install functional at all?

IndigoJo
5th September 2011, 22:39
Spaces in paths are often troublesome, but I don't think that's the issue here.

The error from mingw32-make is a general access violation (NULL pointer, invalid pointer access etc.) If you cannot run mingw32-make from the same command line as CMake then the problem is not CMake. Is your MingW install functional at all?

I haven't tried, other than trying to compile this program. It's the same MinGW that came with the most recent Qt SDK (version 1.1.3, Qt v4.7.4). I haven't tried to run make, as I've no Makefile until CMake is run.

ChrisW67
6th September 2011, 01:36
CMake is failing because mingw32-make is failing. You won't fix CMake until you can run mingw32-make from the command prompt you are using.

Run the "Qt 4.7.4 for Desktop (MinGW)" from Start > Qt SDK > Desktop to get a working Qt command prompt. Then try "mingw32-make -v" to verify that at least this much is working before trying to use CMake.

IndigoJo
6th September 2011, 11:30
CMake is failing because mingw32-make is failing. You won't fix CMake until you can run mingw32-make from the command prompt you are using.

Run the "Qt 4.7.4 for Desktop (MinGW)" from Start > Qt SDK > Desktop to get a working Qt command prompt. Then try "mingw32-make -v" to verify that at least this much is working before trying to use CMake.



C:\Windows\system32>mingw32-make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32

IndigoJo
12th September 2011, 22:15
Update: the problem was solved by installing the library-only download (instead of the Qt SDK) and the separate MinGW zipfile from the Qt Downloads page. The problem is obviously with the SDK. I do not use Qt Creator anyway (I use Vim and the command line).