:

Errors when compiling

Added by: ~sim642, 2010 II 27

Added by: ~sim642, 2010 II 27

I get errors when compiling 1st sample on Mingw32.

C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathuint.h|3377|error: `wostream' is neither function nor member function; cannot be declared friend|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathuint.h|3377|error: expected `;' before '&' token|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathuint.h|3383|error: expected `;' before "private"|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathuint.h|3430|error: `wistream' is neither function nor member function; cannot be declared friend|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathuint.h|3430|error: expected `;' before '&' token|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathuint.h|3471|error: expected `;' before "private"|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathint.h|1478|error: `wostream' is neither function nor member function; cannot be declared friend|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathint.h|1478|error: expected `;' before '&' token|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathint.h|1485|error: expected `;' before "private"|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathint.h|1538|error: `wistream' is neither function nor member function; cannot be declared friend|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathint.h|1538|error: expected `;' before '&' token|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathint.h|1543|error: expected `;' before '}' token|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathbig.h|5132|error: `wostream' is neither function nor member function; cannot be declared friend|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathbig.h|5132|error: expected `;' before '&' token|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathbig.h|5138|error: expected `;' before "private"|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathbig.h|5226|error: `wistream' is neither function nor member function; cannot be declared friend|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathbig.h|5226|error: expected `;' before '&' token|
C:\Program Files\CodeBlocks\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\.. \..\include\ttmath\ttmathbig.h|5231|error: expected `;' before '}' token|
||=== Build finished: 18 errors, 0 warnings ===|

I guess they appear because mingw32 hasn't got wide characters and wide strings. Any way to fix this?

Added by: tomek, 2010 III 01, Last modified: 2010 III 01

Download the latest version: 0.9.2 prerelease . I have added a macro TTMATH_DONT_USE_WCHAR, define this macro when compiling.

Btw mingw is a MS Windows port of GCC compiler, your version is probably 3.4.5 and is a little outdated. The current version of GCC is 4.4.3. But unfortunately those binaries provided by www.mingw.org don't support wide characters too. I have checked version 4.4.0 and wchar_t was in ::tr1 there.

I am using mingw compiled from sources by myself and wide characters work well.
$ gcc -v
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.3.4/configure --prefix=/mingw/4.3.4 --build=mingw32 --host=mingw32 --target=mingw32 --with-gcc --with-gnu-as --enable-threads=win32 --disable-nls --enable-languages=c,c++ --disable-win32-registry --disable-shared --with-as=/mingw/4.3.4/bin/as.exe --with-ld=/mingw/4.3.4/bin/ld.exe --with-gmp=/mingw/4.3.4 --with-mpfr=/mingw/4.3.4 --enable-checking=yes
Thread model: win32
gcc version 4.3.4 (GCC)