I want to use "i686-5.2.0-posix-dwarf-rt_v4-rev0" and "x86_64-5.2.0-posix-seh-rt_v4-rev0" on a Windows 7 x64 installation to easily build 32 and 64 bit binaries. It doesn't work that simple.
Not adding the "bin" folder to the PATH variable makes GCC fail, because it can't find its files (libwinpthread-1.dll), even if called via full path. Having the 32 bit "bin" folder set and calling the 64 bit GCC with full path fails because it tries to load 32 bit libraries from the PATH set folder.
I cannot use GCC with full path while its correct "bin" Folder is not added to PATH.
The option '-m64' for the 32 bit GCC says: "sorry, unimplemented: 64-bit mode not compiled in"
The option '-m32' for the 64 bit GCC shows many lines like: "c:/mingw-w64/x86_64-5.2.0-posix-seh-rt_v4-rev0/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw-w64/x86_64-5.2.0-posix-seh-rt_v4-rev0/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../x86_64-w64-mingw32/lib/libmingw32.a when searching for -lmingw32"
There should be a way to set PATH to the default compiler, which is able to locate the other bitness version (via config file) and forwards all parameters to it.
At least it should be possible to call the compiler via full path, so it finds its own files.
Currently the best I can do is using something like this batch file:
SETLOCAL
Set PATH=c:\mingw-w64\i686-5.2.0-posix-dwarf-rt_v4-rev0\bin\
gcc -m32 a.c -o a32.exe
Set PATH=c:\mingw-w64\x86_64-5.2.0-posix-seh-rt_v4-rev0\bin\
gcc -m64 a.c -o a64.exe
ENDLOCAL
Last edit: murkymark 2015-10-27