Unable to cross-compile using mingw-w64 on Ubuntu

1,792 views
Skip to first unread message

wolfy1339

unread,
Feb 16, 2015, 3:42:18 PM2/16/15
to corsix...@googlegroups.com
Hi, I was trying to compile CorsixTH (024ea8a5053f38e5097439e0cf81a2bcc2432590) on Ubuntu Utopic (14.10) and CMake was complaining that my compiler was broken, I tried reinstalling it but that didn't help.
I am using this command to configure CMake.

cmake -DCMAKE_TOOLCHAIN_FILE=build_files/tolchain-mingw.cmake -DSDL_LIBRARY=/usr/i686-w64-mingw32/lib/libSDL2.dll.a -DSDL_INCLUDE_DIR=/usr/i686-w64-mingw32/include/SDL2 -DSDLMAIN_LIBRARY=/usr/i686-w64-mingw32/lib/libSDL2main.a -DSDLMIXER_INCLUDE_DIR=/usr/i686-w64-mingw32/include/SDL2 -DSDLMIXER_LIBRARY=/usr/i686-w64-mingw32/lib/libSDL2_mixer.dll.a -DWITH_MOVIES=Off -DWITH_FREETYPE2=Off -DWITH_LUAJIT=On -DLUA_INCLUDE_DIR=/usr/i686-w64-mingw32/includ
e
/luajit-2.0 -DLUA_LIBRARY=/usr/i686-w64-mingw32/lib/libluajit.a

Here is CMake's output with that command:
-- The C compiler identification is GNU 4.9.1-- The CXX compiler identification is GNU 4.9.1
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
 
The C compiler "/usr/bin/i686-w64-mingw32-gcc" is not able to compile a
 simple test program
.

 
It fails with the following output:

 
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

 

 
Run Build Command:/usr/bin/make "cmTryCompileExec1141899754/fast"

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

 make
[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'

 
/usr/bin/cmake -E cmake_progress_report
 
/root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1

 
Building C object
 
CMakeFiles/cmTryCompileExec1141899754.dir/testCCompiler.c.o

 
/usr/bin/i686-w64-mingw32-gcc -o
 
CMakeFiles/cmTryCompileExec1141899754.dir/testCCompiler.c.o -c
 
/root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c

 
Linking C executable cmTryCompileExec1141899754

 
/usr/bin/cmake -E cmake_link_script
 
CMakeFiles/cmTryCompileExec1141899754.dir/link.txt --verbose=1

 
/usr/bin/i686-w64-mingw32-gcc
 
CMakeFiles/cmTryCompileExec1141899754.dir/testCCompiler.c.o -o
 cmTryCompileExec1141899754
-rdynamic

 i686
-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'

 
CMakeFiles/cmTryCompileExec1141899754.dir/build.make:91: recipe for target
 
'cmTryCompileExec1141899754' failed

 make
[1]: *** [cmTryCompileExec1141899754] Error 1

 make
[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'

 
Makefile:117: recipe for target 'cmTryCompileExec1141899754/fast' failed

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

 

 

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


-- Configuring incomplete, errors occurred!
See also "/root/CorsixTH/CMakeFiles/CMakeOutput.log".
See also "/root/CorsixTH/CMakeFiles/CMakeError.log".

CMakeError.log:
Determining if the C compiler works failed with the following output:
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec959506174/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec959506174.dir/build.make CMakeFiles/cmTryCompileExec959506174.dir/build
make[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec959506174.dir/testCCompiler.c.o
/usr/bin/i686-w64-mingw32-gcc    -o CMakeFiles/cmTryCompileExec959506174.dir/testCCompiler.c.o   -c /root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec959506174
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec959506174.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec959506174.dir/testCCompiler.c.o  -o cmTryCompileExec959506174 -rdynamic 
i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTryCompileExec959506174.dir/build.make:91: recipe for target 'cmTryCompileExec959506174' failed
make[1]: *** [cmTryCompileExec959506174] Error 1
make[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec959506174/fast' failed
make: *** [cmTryCompileExec959506174/fast] Error 2


Determining if the C compiler works failed with the following output:
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec3694010872/fast"
make[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/make -f CMakeFiles/cmTryCompileExec3694010872.dir/build.make CMakeFiles/cmTryCompileExec3694010872.dir/build
make[2]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3694010872.dir/testCCompiler.c.o
/usr/bin/i686-w64-mingw32-gcc    -o CMakeFiles/cmTryCompileExec3694010872.dir/testCCompiler.c.o   -c /root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec3694010872
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3694010872.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec3694010872.dir/testCCompiler.c.o  -o cmTryCompileExec3694010872 -rdynamic 
i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTryCompileExec3694010872.dir/build.make:91: recipe for target 'cmTryCompileExec3694010872' failed
make[2]: *** [cmTryCompileExec3694010872] Error 1
make[2]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec3694010872/fast' failed
make[1]: *** [cmTryCompileExec3694010872/fast] Error 2
make[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'


Determining if the C compiler works failed with the following output:
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec3513947514/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3513947514.dir/build.make CMakeFiles/cmTryCompileExec3513947514.dir/build
make[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3513947514.dir/testCCompiler.c.o
/usr/bin/i686-w64-mingw32-gcc    -o CMakeFiles/cmTryCompileExec3513947514.dir/testCCompiler.c.o   -c /root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec3513947514
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3513947514.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec3513947514.dir/testCCompiler.c.o  -o cmTryCompileExec3513947514 -rdynamic 
i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTryCompileExec3513947514.dir/build.make:91: recipe for target 'cmTryCompileExec3513947514' failed
make[1]: *** [cmTryCompileExec3513947514] Error 1
make[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec3513947514/fast' failed
make: *** [cmTryCompileExec3513947514/fast] Error 2


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/i686-w64-mingw32-g++ 
Build flags: 
Id flags: 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/i686-w64-mingw32-g++ 
Build flags: 
Id flags: -c

The output was:
No such file or directory


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Determining if the C compiler works failed with the following output:
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec177171381/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec177171381.dir/build.make CMakeFiles/cmTryCompileExec177171381.dir/build
make[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec177171381.dir/testCCompiler.c.o
/usr/bin/i686-w64-mingw32-gcc    -o CMakeFiles/cmTryCompileExec177171381.dir/testCCompiler.c.o   -c /root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec177171381
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec177171381.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec177171381.dir/testCCompiler.c.o  -o cmTryCompileExec177171381 -rdynamic 
i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTryCompileExec177171381.dir/build.make:91: recipe for target 'cmTryCompileExec177171381' failed
make[1]: *** [cmTryCompileExec177171381] Error 1
make[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec177171381/fast' failed
make: *** [cmTryCompileExec177171381/fast] Error 2


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/i686-w64-mingw32-g++ 
Build flags: 
Id flags: 

The output was:
No such file or directory


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /usr/bin/i686-w64-mingw32-g++ 
Build flags: 
Id flags: -c

The output was:
No such file or directory


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Determining if the C compiler works failed with the following output:
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec712858266/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec712858266.dir/build.make CMakeFiles/cmTryCompileExec712858266.dir/build
make[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec712858266.dir/testCCompiler.c.o
/usr/bin/i686-w64-mingw32-gcc    -o CMakeFiles/cmTryCompileExec712858266.dir/testCCompiler.c.o   -c /root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec712858266
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec712858266.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec712858266.dir/testCCompiler.c.o  -o cmTryCompileExec712858266 -rdynamic 
i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTryCompileExec712858266.dir/build.make:91: recipe for target 'cmTryCompileExec712858266' failed
make[1]: *** [cmTryCompileExec712858266] Error 1
make[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec712858266/fast' failed
make: *** [cmTryCompileExec712858266/fast] Error 2


Determining if the C compiler works failed with the following output:
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1333037816/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1333037816.dir/build.make CMakeFiles/cmTryCompileExec1333037816.dir/build
make[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1333037816.dir/testCCompiler.c.o
/usr/bin/i686-w64-mingw32-gcc    -o CMakeFiles/cmTryCompileExec1333037816.dir/testCCompiler.c.o   -c /root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec1333037816
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1333037816.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec1333037816.dir/testCCompiler.c.o  -o cmTryCompileExec1333037816 -rdynamic 
i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTryCompileExec1333037816.dir/build.make:91: recipe for target 'cmTryCompileExec1333037816' failed
make[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec1333037816] Error 1
Makefile:117: recipe for target 'cmTryCompileExec1333037816/fast' failed
make: *** [cmTryCompileExec1333037816/fast] Error 2


Determining if the C compiler works failed with the following output:
Change Dir: /root/CorsixTH/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/make "cmTryCompileExec1141899754/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec1141899754.dir/build.make CMakeFiles/cmTryCompileExec1141899754.dir/build
make[1]: Entering directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /root/CorsixTH/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1141899754.dir/testCCompiler.c.o
/usr/bin/i686-w64-mingw32-gcc    -o CMakeFiles/cmTryCompileExec1141899754.dir/testCCompiler.c.o   -c /root/CorsixTH/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec1141899754
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1141899754.dir/link.txt --verbose=1
/usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec1141899754.dir/testCCompiler.c.o  -o cmTryCompileExec1141899754 -rdynamic 
i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
CMakeFiles/cmTryCompileExec1141899754.dir/build.make:91: recipe for target 'cmTryCompileExec1141899754' failed
make[1]: *** [cmTryCompileExec1141899754] Error 1
make[1]: Leaving directory '/root/CorsixTH/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec1141899754/fast' failed
make: *** [cmTryCompileExec1141899754/fast] Error 2

Stephen E. Baker

unread,
Feb 17, 2015, 3:16:12 PM2/17/15
to corsix...@googlegroups.com
You have a typo in the CMAKE_TOOLCHAIN_FILE.  Too o's in toolchain.

Enjoy.


On 2015-02-16 3:42 PM, wolfy1339 wrote:
Hi, I was trying to compile CorsixTH (024ea8a5053f38e5097439e0cf81a2bcc2432590) on Ubuntu Utopic (14.10) and CMake was complaining that my compiler was broken, I tried reinstalling it but that didn't help.
I am using this command to configure CMake.

cmake -DCMAKE_TOOLCHAIN_FILE=build_files/tolchain-mingw.cmake -DSDL_LIBRARY=/usr/i686-w64-mingw32/lib/libSDL2.dll.a -DSDL_INCLUDE_DIR=/usr/i686-w64-mingw32/include/SDL2 -DSDLMAIN_LIBRARY=
<
span style="color: #080;" class="styled-by-prettify">/usr/

--
You received this message because you are subscribed to the Google Groups "CorsixTH Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to corsix-th-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wolfy1339

unread,
Feb 17, 2015, 4:57:19 PM2/17/15
to corsix...@googlegroups.com
I have tried that, and sadly still get the same error message
...

Stephen E. Baker

unread,
Feb 18, 2015, 8:54:42 AM2/18/15
to corsix...@googlegroups.com
Well I imagine the main problem is still with the toolchain: See http://www.cmake.org/Bug/view.php?id=13855

To find your error I'll need a pastebin that tells me everything you did to set it up (installing the dependencies, cloning corsixth, running cmake) including paths.

SET(CMAKE_SYSTEM_NAME Windows) should be disabling -rdynamic.
--

wolfy1339

unread,
Feb 18, 2015, 8:46:22 PM2/18/15
to corsix...@googlegroups.com
For the dependencies, I just downloaded SDL and SDL mixer from the SDL website. LuaJIT, I compiled it myself. I cloned CorsixTH using "git clone git://github.com/CorsixTH/CorsixTH.git"
i changed directory to CorsixTH and ran "cmake -DCMAKE_TOOLCHAIN_FILE=build_files/toolchain-mingw.cmake -DSDL_LIBRARY=/usr/i686-w64-mingw32/lib/libSDL2.dll.a -DSDL_INCLUDE_DIR=/usr/i686-w64-mingw32/include/SDL2 -DSDLMAIN_LIBRARY=/usr/i686-w64-mingw32/lib/libSDL2main.a -SDLMIXER_INCLUDE_DIR=/usr/i686-w64-mingw32/include/SDL2 -DSDLMIXER_LIBRARY=/usr/i686-w64-mingw32/lib/libSDL2_mixer.dll.a -DWITH_MOVIES=Off -DWITH_FREETYPE2=Off -DWITH_LUAJIT=On -DLUA_INCLUDE_DIR=/usr/i686-w64-mingw32/include/luajit-2.0 -DLUA_LIBRARY=/usr/i686-w64-mingw32/lib/libluajit.a -DCMAKE_SYSTEM_NAME=Windows"
Cmake version: 2.8.12.2
Reply all
Reply to author
Forward
0 new messages