简体   繁体   English

C ++ Builder:#include <iostream> 错误

[英]C++ Builder : #include <iostream> error

I am testing a new version of CBuilder (version XE2). 我正在测试新版本的CBuilder(XE2版)。 Most of commnon includes are redirected to boost library or to dinkumware libraries (some STL implementation?). 大多数常用命令都被重定向到boost库或dinkumware库(某些STL实现?)。

#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: 并中断xlocnum和xlocale文件的处理,并出现以下错误:

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? 我从“包含路径”中删除了所有项目,为什么IDE仍包含dinkumware库而不是普通库?

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... 较旧的版本(C ++ Builder 2010)运行良好...

Thanks for your help. 谢谢你的帮助。

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. 我有一个项目开始生成类似错误,并且发现我已在“编译器设置”选项卡中将代码合规性设置从Borland / Codegear更改为ANSI。 Changing it back eliminated the errors. 改回来消除了错误。

Does your #ifndef have a matching #endif at the end of the header file? 您的#ifndef头文件末尾是否有匹配的#endif?

What's the smallest use complete sample code that produces this error? 产生此错误的最小的使用完整示例代码是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM