4
votes

I am testing a new version of CBuilder (version XE2). Most of commnon includes are redirected to boost library or to dinkumware libraries (some STL implementation?).

#ifndef Error_H
#define Error_H

#include <exception>
#include <iostream> //Error message, see bellow, please

but the compilation is stopped with following (and strange) 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 is a fact, that compilation had been stopped before my own source code was compiled... The compiler is browsing 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 be the problem? I removed all items from "include paths", why IDE still includes dinkumware libraries instead of common 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 older version (C++ Builder 2010) works well...

Thanks for your help.

2
Already with that problem, or solved? - kokbira
Have you tried rebuilding everything from scratch? Undefined symbols after an update can probably indicate precompiled headers or non-rebuilt binaries. - bipll

2 Answers

1
votes

Does your #ifndef have a matching #endif at the end of the header file?

What's the smallest use complete sample code that produces this error?

1
votes

I know this is an OLD post, but someone may find it on an internet search, like I did. Check your project settings; I had a project that started generating similar errors, and found out that I had changed the code compliance setting from Borland/Codegear to ANSI in the Compiler settings tab. Changing it back eliminated the errors.