[Insight-users] Problems building itk under MinGW

URI zallen at wheelinghospital.com
Mon Dec 21 13:49:30 EST 2009


Michael-

I tried following your instructions on my WinXP machine instead of my
Windows 7 machine, which I've been using up till now.  When installing MinGW
I only selected "MinGW base tools" and "g++ compiler".  Am I supposed to
check anything else, like "MinGW Make" or "Objective C Compiler"?

When installing msys it didn't ask me to confirm the location of MinGW,
which I guess is where my problem is arising.

After typing in the line

 cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug ../

I get this output:

============================

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /MinGW/bin/gcc.exe
-- Check for working C compiler: /MinGW/bin/gcc.exe -- broken
CMake Error at
C:/CMake28/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:50 (M
ESSAGE):
  The C compiler "/MinGW/bin/gcc.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: C:/ITK-3.16.0/Build/CMakeFiles/CMakeTmp



  Run Build Command:C:/msys/1.0/bin/make.exe "cmTryCompileExec/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory `/c/ITK-3.16.0/Build/CMakeFiles/CMakeTmp'

  /C/CMake28/bin/cmake.exe -E cmake_progress_report
  /C/ITK-3.16.0/Build/CMakeFiles/CMakeTmp/CMakeFiles 1

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

  /MinGW/bin/gcc.exe -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj
  -c /C/ITK-3.16.0/Build/CMakeFiles/CMakeTmp/testCCompiler.c

  make[1]: /MinGW/bin/gcc.exe: Command not found

  make[1]: Leaving directory `/c/ITK-3.16.0/Build/CMakeFiles/CMakeTmp'

  make[1]: *** [CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.obj] Error
  127

  make: *** [cmTryCompileExec/fast] Error 2




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


-- Configuring incomplete, errors occurred!

============================

For some reason it seems like it can't see the gcc.exe compiler in the
MinGW/bin folder, but it's there.  I installed MinGW and msys in the order
you specified and accepted whatever default values the installers provided,
so I don't think I messed anything up there.  How do I make sure that msys
knows where MinGW is?






Try

"cd /c/"
  and see if that gets you somewhere.

Quick Suggestion for MSys/MinGW.

Install MinGW FIRST
Install MSYS Next. During that install MSYS will find MinGW (most  
likely) and ask you to verify the path. DO THIS correctly or you will  
just basically hose up MinGW/MSYS.

When all that is working there should be an "Msys" icon on your  
desktop. Double click that and an ugly terminal should pop up. You  
should be sitting in your home directory (the Msys Home, which may be  
different than your Windows home).

Stay in MSYS shell from here on out.
Install ITK into C:/ITK-3.16.0 so that if you performed an "ls" inside  
of C:/ITK-3.16.0 you would get the listing of things like  
"Applications", "Code", "Examples" and stuff like that.
Now, from still inside that C:/ITK-3.16.0 directory perform the  
following:

[msys ] $ mkdir Build
[msys ] $ cd Build
[msys ] $ cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug ../
......
[msys ] $ make
....
[msys ] $

That _should_ build ITK with MSYS. This was valid the last time I did  
it on Windows XP 32 bit SP3 and the last stable MSys/MinGW (when GCC  
was at version 3.3 or something like that).

hope some of that helps.
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio


-- 
View this message in context: http://n2.nabble.com/Problems-building-itk-under-MinGW-tp4104133p4199909.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list