Compilation workaround for older MinGW versions (Win only)

see issue 847
This commit is contained in:
Oliver Duis 2011-07-18 22:18:42 +02:00
parent 9716b235d6
commit fdb490c49f
2 changed files with 17 additions and 8 deletions

View File

@ -35,20 +35,22 @@ Windows
This tutorial assume that you've installed the packages in paths THAT DOES NOT CONTAIN SPACES. This tutorial assume that you've installed the packages in paths THAT DOES NOT CONTAIN SPACES.
METHOD 1: METHOD 1:
- MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download) - MinGW64-TDM (Bundle or On-Demand insteller from http://tdm-gcc.tdragon.net/download)
OpenMP seems to be broken in TDM-GCC4.5.1, so when MinGW has been installed, download and install Make sure you use the current 4.5.2 or better, and install MinGW64 (not MinGW32)
libgomp form tdm-gcc-4.5.0 MinGW64 is more comprehensive, plus it runs AND compiles both 32bit and 64bit Windows.
(http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%204.5%20series/Previous/4.5.0-tdm-1%20SJLJ/gcc-4.5.0-tdm-1-openmp.zip/download) Old Mingw32 version miss some required header files, so some Windows functions will be disabled though it will compile.
- MSYS (http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe) - MSYS (http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe)
If you have some trouble installing MSYS, see here : http://www.mingw.org/wiki/MSYS If you have some trouble installing MSYS, see here : http://www.mingw.org/wiki/MSYS
- CMake (http://www.cmake.org/cmake/resources/software.html) - CMake (http://www.cmake.org/cmake/resources/software.html)
Version 2.8.4 or above si required for this platform Version 2.8.4 or above is required for this platform
- Gtkmm2.22 (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/) - Gtkmm2.22 (for 32bit: http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/
for 64bit: http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/)
METHOD 2: METHOD 2:
- MinGW-TDM (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.5.1.exe/download) - MinGW-TDM (Bundle or On-Demand insteller from http://tdm-gcc.tdragon.net/download)
- CMake (http://www.cmake.org/cmake/resources/software.html) - CMake (http://www.cmake.org/cmake/resources/software.html)
- Gtkmm2.22 (http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/) - Gtkmm2.22 (for 32bit: http://ftp.se.debian.org/pub/gnome/binaries/win32/gtkmm/2.22/
for 64bit: http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/)
Additionnal steps: Additionnal steps:
When all the packages of your preferred method are installed: When all the packages of your preferred method are installed:

View File

@ -96,11 +96,15 @@ bool MultiLangMgr::save (Glib::ustring fname) {
bool MultiLangMgr::isOSLanguageDetectSupported() { bool MultiLangMgr::isOSLanguageDetectSupported() {
#ifdef WIN32 #ifdef WIN32
#ifdef __MINGW64_VERSION_MAJOR
// Only on Vista or above // Only on Vista or above
return LOBYTE(LOWORD(GetVersion()))>=6; return LOBYTE(LOWORD(GetVersion()))>=6;
#else #else
return false; return false;
#endif #endif
#else
return false;
#endif
} }
@ -112,6 +116,8 @@ Glib::ustring MultiLangMgr::getOSUserLanguage() {
// TODO: Add support for other OS here // TODO: Add support for other OS here
#ifdef WIN32 #ifdef WIN32
// When using old versions of MINGW this is not defined
#ifdef __MINGW64_VERSION_MAJOR
WCHAR langRFCU[64] = {0}; WCHAR langRFCU[64] = {0};
if (GetUserDefaultLocaleName(langRFCU,64)!=0 && lstrlenW(langRFCU)>=2) { if (GetUserDefaultLocaleName(langRFCU,64)!=0 && lstrlenW(langRFCU)>=2) {
// convert UNICODE16 to GTK // convert UNICODE16 to GTK
@ -121,6 +127,7 @@ Glib::ustring MultiLangMgr::getOSUserLanguage() {
langName=TranslateRFC2Language(localRFC); langName=TranslateRFC2Language(localRFC);
} }
#endif
#endif #endif
} else printf("Automatic language detection not supported on your OS\n"); } else printf("Automatic language detection not supported on your OS\n");