C ++ Builder: #include <iostream> error
I am testing a new version of CBuilder (version XE2). Most commnon components are redirected to increase the dinkumware library or libraries (some implementations of STL?).
#ifndef Error_H #define Error_H #include <exception> #include <iostream> //Error message, see bellow, please but compilation is stopped by the following (and weird) messages:
[BCC32 Error] xlocale(1392): E2451 Undefined symbol 'MB_LEN_MAX'[BCC32 Error] xlocale(1763): [BCC32 Error] xlocnum(1495): E2451 Undefined symbol 'CHAR_MAX' Full parser context xlocnum(1487): decision to instantiate: ostreambuf_iterator<char,char_traits<char> > numput::_Iput(ostreambuf_iterator<char,char_traits<char> >,ios_base &,char,char *,unsigned int) const --- Resetting parser context for instantiation... detectproj.cpp(22): #include c:\program files\embarcadero\rad studio\9.0\include\dinkumware\iostream iostream(5): #include c:\program files\embarcadero\rad studio\9.0\include\dinkumware\istream istream(5): #include c:\program files\embarcadero\rad studio\9.0\include\dinkumware\ostream ostream(5): #include c:\program files\embarcadero\rad studio\9.0\include\dinkumware\ios ios(5): #include c:\program files\embarcadero\rad studio\9.0\include\dinkumware\xlocnum xlocnum(30): namespace std xlocnum(1036): class num_put<_Elem,_OutIt> xlocnum(1487): parsing: ostreambuf_iterator<char,char_traits<char> > numput::_Iput(ostreambuf_iterator<char,char_traits<char> >,ios_base An interesting fact is that compilation was stopped before my source code was compiled ... The compiler looks at the included files in the following order:
iostream -> istream -> ostream -> ios-> xlocnnum iostream -> istream -> ostream -> ios-> xlocnnum -> streambuf -> xiosbase ->xlocale and interrupts the processing of xlocnum and xlocale files with the following errors:
E2451 Undefined symbol 'CHAR_MAX' E2451 Undefined symbol 'MB_LEN_MAX' Where could the problem be? I removed all the elements from the "include paths", why does the IDE still include dinkumware libraries instead of regular libraries?
Settings:
Link with dynamic RTL: Off CodeGuard: On Directories and Conditionals/All configurations/Include Path: Empty Directories and Conditionals/All configurations/Library Path: Empty No pragma hdrstop, #pragma argsused are used in my code. The old version (C ++ Builder 2010) works well ...
Thank you for your help.
I know this is an OLD post, but someone can find it on the Internet like me. Check project settings; I had a project that started to create such errors, and found out that I changed the code compliance setting from Borland / Codegear to ANSI on the "Compiler Options" tab. By changing this, we fixed the errors.