Can't compile LE on MinGW (std::wifstream issue)

trilader

29-08-2010 19:02:55

Hi, I can't compile the Layout Editor on Windows using MinGW 4.4.1 and Ogre 1.7.1 with MyGUI-SVN (Revision: 3397) on Windows 7 (both x86 and x64).
I get an error message about std::wifstream.open() not accepting the wchar_t but requiring a const char* instead.

Compiler Output:
[ 73%] Building CXX object Tools/LayoutEditor/CMakeFiles/LayoutEditor.dir/Application.cpp.obj
D:\MyGui\mygui-r3397\Tools\LayoutEditor\Application.cpp: In member function 'virtual void tools::Application::prepare()':
D:\MyGui\mygui-r3397\Tools\LayoutEditor\Application.cpp:399: error: no matching function for call to 'std::basic_ifstream<wchar_t, std::char_traits<wchar_t> >::open(const wchar_t*)'
c:\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/fstream:525: note: candidates are: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = wchar_t, _Traits = std::char_traits<wchar_t>]
D:\MyGui\mygui-r3397\Tools\LayoutEditor\Application.cpp:424: error: no matching function for call to 'std::basic_ifstream<wchar_t, std::char_traits<wchar_t> >::open(const wchar_t*)'
c:\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/fstream:525: note: candidates are: void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = wchar_t, _Traits = std::char_traits<wchar_t>]
mingw32-make.exe[2]: *** [Tools/LayoutEditor/CMakeFiles/LayoutEditor.dir/Application.cpp.obj] Error 1
mingw32-make.exe[1]: *** [Tools/LayoutEditor/CMakeFiles/LayoutEditor.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2


The error has been there for a while.

I hope this can be fixed.

Altren

29-08-2010 21:41:53

Thank you. You should've reported earlier if you seen that before. It's pretty easy to fix, but neither me nor my.name use MinGW, I only run it from time to time to test.

Altren

29-08-2010 21:57:15

Fixed.

trilader

29-08-2010 21:58:56

That was fast! I'll test it now. And if I encounter any more bugs I'll let you know as soon as I find them in future.

Thanks
-trilader