View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008516CMakeCMakepublic2009-02-11 16:142016-06-10 14:30
ReporterLudovic Magerand 
Assigned ToBill Hoffman 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0008516: Failled to test C compiler with MinGW
DescriptionI was trying to generate Code::Blocks project using CMake 2.6.2-patch2 and this is failling with error like the one in the log provided as additional information.

I tested with other generators using MinGW, and they all fails with the exact same error.
I also tested with the nightly build of CMake 2.7 of a few days ago, the same thing happen.

I now use the latest MinGW and utils freshly downloaded but I originaly tried with the MinGW embedded into Code::Blocks 8.02, same happen on both.

As I'm reading the log again, I just remarks that there is a "é" in the path to the written file, so I just tested on a new directory without such character and it's working.

I'm not sure if it's a CMake or MinGW bug but as I found it with CMake I report it there.
Additional InformationThe C compiler identification is GNU
The CXX compiler identification is GNU
Check for working C compiler: C:/MinGW/bin/gcc.exe
Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:32 (MESSAGE):
  The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test

  It fails with the following output:

   Change Dir: C:/Documents and Settings/Propriétaire/Mes documents/Lasmea/Essai/CMakeFiles/CMakeTmp


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

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

  mingw32-make.exe[1]: Entering directory `C:/Documents and
  Settings/Propriétaire/Mes documents/Lasmea/Essai/CMakeFiles/CMakeTmp'

  "C:\Program Files\CMake 2.6\bin\cmake.exe" -E cmake_progress_report
  "C:\Documents and Settings\Propriétaire\Mes
  documents\Lasmea\Essai\CMakeFiles\CMakeTmp\CMakeFiles" 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj

  C:\MinGW\bin\gcc.exe -o CMakeFiles\cmTryCompileExec.dir\testCCompiler.c.obj
  -c "C:\Documents and Settings\Propriétaire\Mes

  gcc.exe: C:\Documents and Settings\PropriÚtaire\Mes
  documents\Lasmea\Essai\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or

  gcc.exe: no input files

  mingw32-make.exe[1]: ***
  [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error 1

  mingw32-make.exe[1]: Leaving directory `C:/Documents and
  Settings/Propriétaire/Mes documents/Lasmea/Essai/CMakeFiles/CMakeTmp'

  mingw32-make.exe: *** [cmTryCompileExec/fast] Error 2



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

Configuring incomplete, errors occurred!
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
Ludovic Magerand (reporter)
2009-02-12 05:08

After having successfuly generated the Code::Blocks project file, I opened it and tried to compile the project.

The result is a failure because it fails to get the source files which where also on a path containing a "é".
So I also moved the source dir to something whitout such character and it worked nicely.

I took the time to get a closer look on the generated files, the problem is that those files are UTF-8 encoded and so are the differents filename, which on Windows is incorrect as the filesystem store filenames in another encoding.

Maybe the bug is upstream as MinGW should maybe convert filenames and directories in the system encoding ?
Bill Hoffman (manager)
2009-02-12 11:55

Can you try setting LC_ALL=POSIX and LC_MESSAGES=C before running CMake?
Ludovic Magerand (reporter)
2009-02-13 06:49

I still get the same error.
Bill Hoffman (manager)
2009-02-13 09:17

Can you compile a file in this directory:

Without CMake?

gcc -c C:\Documents and Settings\PropriÚtaire\foo.c

If not, then this is not a CMake bug, and there is nothing that can be done from CMake.
Ludovic Magerand (reporter)
2009-02-14 05:50

I tried 3 differents way to do this, they all succeded to compile foo.c.
The two firsts one are :
- In console being in the directory of foo.c and running gcc -o foo.exe foo.c
- In console being in C:\ and running gcc -o "C:\Documents and Settings\Propriétaire\Mes documents\Lasmea\foo.exe" "C:\Documents and Settings\Propriétaire\Mes documents\Lasmea\foo.c"

But in those case, the "é" is correctly encoded as it's the Windows shell that generate it (either beeing in th current working directory or as the parameter).

The other test I did was using Code::Blocks, and it's working fine too. So Code::Blocks generate correctly encoded strings, meaning that it's possible for CMake too I guess.

Now I'm looking back at the log, and I see that at some places CMake generate correctly encoded string as all the first lines are actualy good.
CMake is able to create the directories "C:/Documents and Settings/Propriétaire/Mes documents/Lasmea/Essai/CMakeFiles/CMakeTmp" and go into it.

But when it tries to write the test file "testCCompiler.c" in this directory, then it use a badly encoded string resulting in a failure to create it (there is no such file in this directory).

Maybe the bug is only around the creation of this test file ?
Bill Hoffman (manager)
2010-03-28 21:51

Try this:

In an empty directory:

cd newdir
cmake -G "The generator you are using" --debug-trycompile

Obviously replace the above string with the generator that is causing you the trouble...

This will leave the temporary files in place. You can then do this:

cd CMakeFiles/CMakeTmp


That will run the makefile that is failing. If you can figure out how to fix that makefile that might help.

Looks like the best way to get this working, would be to install CMake into a directory that does not have international chars in it.
Sergey (reporter)
2015-05-19 03:00

The bug is still not fixed with the latest cmake.

here is an example of output

[C:\Users\rion\Desktop\Psi+ Проджект\qca]"\Program Files (x86)\CMake\bin\cmake.exe" -G "MinGW Makefiles" --debug-trycompile
debug trycompile on
-- The C compiler identification is GNU 4.9.1
-- The CXX compiler identification is GNU 4.9.1
-- Check for working C compiler: C:/Qt/Tools/mingw491_32/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Tools/mingw491_32/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Qt/Tools/mingw491_32/bin/gcc.exe" is not able to compile
  a simple test program.

  It fails with the following output:

   Change Dir: C:/Users/rion/Desktop/Psi+ ╨Я╤А╨╛╨┤╨╢╨╡╨║╤В/qca/CMakeFiles/CMakeTmp

  Run Build Command:"C:/Qt/Tools/mingw491_32/bin/mingw32-make.exe"

  C:/Qt/Tools/mingw491_32/bin/mingw32-make.exe -f

  mingw32-make.exe[1]: Entering directory 'C:/Users/rion/Desktop/Psi+

  "C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report
  ╨Я╤А╨╛╨┤╨╢╨╡╨║╤В\qca\CMakeFiles\CMakeTmp\CMakeFiles" 1

  Building C object

  C:\Qt\Tools\mingw491_32\bin\gcc.exe -o
  CMakeFiles\cmTryCompileExec1013668568.dir\testCCompiler.c.obj -c

  gcc.exe: error: C:\Users\rion\Desktop\Psi+
  ╨Я╤А╨╛╨┤╨╢╨╡╨║╤В\qca\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or

  gcc.exe: fatal error: no input files

  compilation terminated.

  mingw32-make.exe[1]: ***
  [CMakeFiles/cmTryCompileExec1013668568.dir/testCCompiler.c.obj] Error 1

  CMakeFiles\cmTryCompileExec1013668568.dir\build.make:56: recipe for target
  'CMakeFiles/cmTryCompileExec1013668568.dir/testCCompiler.c.obj' failed

  mingw32-make.exe[1]: Leaving directory 'C:/Users/rion/Desktop/Psi+

  makefile:116: recipe for target 'cmTryCompileExec1013668568/fast' failed

  mingw32-make.exe: *** [cmTryCompileExec1013668568/fast] Error 2

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

-- Configuring incomplete, errors occurred!
See also "C:/Users/rion/Desktop/Psi+ ╨Я╤А╨╛╨┤╨╢╨╡╨║╤В/qca/CMakeFiles/CMakeOutput.log".
See also "C:/Users/rion/Desktop/Psi+ ╨Я╤А╨╛╨┤╨╢╨╡╨║╤В/qca/CMakeFiles/CMakeError.log".
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

- Issue History
Date Modified Username Field Change
2009-02-11 16:14 Ludovic Magerand New Issue
2009-02-12 05:08 Ludovic Magerand Note Added: 0014908
2009-02-12 11:55 Bill Hoffman Note Added: 0014912
2009-02-12 11:55 Bill Hoffman Status new => assigned
2009-02-12 11:55 Bill Hoffman Assigned To => Bill Hoffman
2009-02-13 06:49 Ludovic Magerand Note Added: 0014923
2009-02-13 09:17 Bill Hoffman Note Added: 0014925
2009-02-14 05:50 Ludovic Magerand Note Added: 0014940
2010-03-28 21:51 Bill Hoffman Note Added: 0020023
2015-05-19 03:00 Sergey Note Added: 0038772
2016-06-10 14:27 Kitware Robot Note Added: 0041501
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed

Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker