C Builder:#include错误

我正在测试新版本的CBuilder(版本XE2).大多数commnon包含被重定向到boost库或dinkumware库(一些STL实现?).

#ifndef Error_H
#define Error_H

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

但是使用以下(和奇怪的)消息停止编译:

[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 

一个有趣的事实是,在编译我自己的源代码之前已经停止了编译…编译器按以下顺序浏览包含的文件:

iostream -> istream -> ostream -> ios-> xlocnnum 
iostream -> istream -> ostream -> ios-> xlocnnum -> streambuf -> xiosbase ->xlocale

并使用以下错误中断xlocnum和xlocale文件的处理:

E2451 Undefined symbol 'CHAR_MAX'
E2451 Undefined symbol 'MB_LEN_MAX'

哪里可能是问题?我从“包含路径”中删除了所有项目,为什么IDE仍然包含dinkumware库而不是公共库?

设置:

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.

旧版本(C Builder 2010)效果很好……

谢谢你的帮助.

最佳答案 你的#ifndef在头文件的末尾是否有匹配的#endif?

什么是最小的使用完整示例代码产生此错误?

点赞