[CMake] cmake MinGW WinXP DevCPP Problems

Tomislav Adamic tomislav.adamic at zg.htnet.hr
Tue Apr 19 17:42:05 EDT 2005





 -------------Original message---------
 From: "David Cole" <david.cole at kitware.com>
 To: <tomislav.adamic at zg.htnet.hr>
 Sent: utorak, 19. travanj 2005, 21:36:10
 Subject: [CMake] cmake MinGW WinXP DevCPP Problems
 > Running CMakeSetup from the same environment that gcc and make run in
> should work when you're using MinGW. I'm not familiar with Dev-Cpp : do
> you run it from an MSYS shell? Or does it know about MinGW independent
> of having MSYS installed?

DevCPP just calls make.exe which he founds available in enviroment
using either default makefile (the one that DevCpp generated) or
Makefile specified by user (for example the one that I write by hand,
or cmake generates.) I tried setting this first to make.exe one that
came bundled with DevCPP (and is also installed by MinGW installer
from MinGW site) Didn't work. Uninstalled DevCpp and tried clean
install of MinGW v 3.1.0-1 with GNU Make v3.80.0-3 didn't work.
MSYS (fresh install) Same result. Then I tried running from MSYS shell
(I think it is zsh ported to win32) and got the same result. Make
error message is a bit diferent,  but that's because of shell used:

$ make
Building dependencies. cmake.depends...
Building object file hello.o...
/bin/sh: o: command not found
Building executable c:/Temp/hello.exe...
/bin/sh: hello.o: command not found
make[1]: *** [c:/Temp/hello.exe] Error 127
make: *** [default_target] Error 2

> Try again with a fresh directory containing just your cpp, h and 
> CMakeLists.txt file. Launch CMakeSetup from a command prompt / MSYS 
> shell that has the environment set to run gcc... (Perhaps launch it from
> within Dev-Cpp? Can it launch external tools easily?)

Well, I mentioned DevCPP here because I thought there might be some
diference in MinGW and compiler that is bundled with DevCPP and that I
don't know about, but someone else is familiar with . But DevCPP is
just on top of it and it inherits compiler setings from enviroment if
there is no compiler within it's install directory (ie. if I have gcc
in my path, no matter where it is, DevCpp will use it, as long as gcc
knows where to find includes/libs. Same goes for make. DevCPP captures
gcc/make output and parses it, but that's all. The only requirement
from it is that Makefile give to it must contain "all" target. Anyway,
I didn't even test it much with cmake generated Makefiles, after the
first failure, because problem was obviously related to make/cmake.

> Sometimes when you've run cmake and CMakeSetup on the same tree, you get
> confused about the state of things and it's easier to start fresh.

Each time I cleaned directory completely (only hello.cpp hello.h and
CMakeLists.txt were left in it). Each time cmake GUI was not able to
configure, and cmd line version configured without errors, but then
make failed.

What it looks like to me is that somehow compiler comand doesn't get
called/executed for the given target:

/bin/sh: o: command not found
/bin/sh: hello.o: command not found

or:

process_begin: CreateProcess((null), o hello.o -c C:/Temp/hello.cpp, ...) failed
CreateProcess((null), hello.o -o C:/Temp/hello.exe, ...) failed

But I can't figure out why...

> HTH,
> David

> Tomislav Adamic wrote:

>>So, I have installed Dev-Cpp IDE which includes MinGW
>>compiler and GNU make. I have set enviroment variables (PATH and gcc
>>variables) for my instalation. Now, I can use IDE to generate my make
>>files but there are some things that I don't like in that case, so I
>>turned to cmake. After unpacking (v 2.0.6) I wanted to try it with
>>simple program. So I created "hello.cpp" and "hello.h" in some dir.
>>Also, in the same dir there is "CMakeLists.txt" containing:
>>
>>PROJECT (hello C++)
>>ADD_EXECUTABLE (hello hello.cpp)
>>
>>After that I run cmake GUI -> configure... (Unix Makefiles generator
>>chosen)
>>It exits with following error:
>>
>>Determining if the C compiler works failed with the following output:
>>process_easy: DuplicateHandle(In) failed (e=6)
>>C:/DeveloperTools/Dev-Cpp/bin/make.exe:
>>Interrupt/Exception caught (code = 0xc0000005, addr = 0x4fe5c7)
>>
>>So, I think to myself, I guess it cannot find compiler or something...
>>after that I clean u my directory and run cmake on the same files
>>(hello.cpp, hello.h and CMakeLists.txt) but now from command line:
>>
>>cmake . -G"Unix Makefiles"
>>
>>which results with following:
>>
>>-- Check for working C compiler: gcc.exe
>>-- Check for working C compiler: gcc.exe -- works
>>-- Configuring done
>>-- Generating done
>>-- Build files have been written to: C:/Temp
>>
>>Assuming, everything is fine, I do "make" and it breaks:
>>
>>"Building dependencies. cmake.depends..."
>>"Building object file hello.o..."
>>process_begin: CreateProcess((null), o hello.o -c C:/Temp/hello.cpp, ...) failed.
>>make (e=2): The system cannot find the file specified.
>>"Building executable C:/Temp/hello.exe..."
>>process_begin: CreateProcess((null), hello.o -o C:/Temp/hello.exe, ...) failed.
>>make (e=2): The system cannot find the file specified.
>>make[1]: *** [C:/Temp/hello.exe] Error 2
>>make: *** [default_target] Error 2
>>
>>So, what is happening here: is may "make.exe" somehow broken (which I
>>seriously doubt, becuse works fine with either manually written or
>>Dev-Cpp generated Makefile(s)) or there is something wrong with cmake,
>>or my config or... Please help... TIA
>>
>>_______________________________________________
>>CMake mailing list
>>CMake at cmake.org
>>http://www.cmake.org/mailman/listinfo/cmake
>>
>>  
>>



More information about the CMake mailing list