dcmtk 3.6.0 error C1083: Cannot open include file: 'iostream.h' 解决办法

2011年1月6日发布的dcmtk 3.6.0版本在编译完毕后, 用自己工程调用dcmdata.lib的过程中发现一个这样的错误: "error C1083: Cannot open include file: 'iostream.h'" 它指向到了一个USE_STD_CXX_INCLUDES的宏定义.

后来在比对它的新版本app的源码时才发现自从某个版本之后为了让旧的iostream.h等能与新的iostream 

STL一起用(之前版本默认是优先STL),在cmake building之后, USE_STD_CXX_INCLUDES的宏定义生成在了building 目录下的"\include\dcmtk\config\osconfig.h"里. (以前在3.5.4它的宏定义在"cfwin32.h"里, 从source目录里拷贝"osconfig.h"和"cfwin32.h"即可完成此宏的定义)这个请大家注意下.

 

所以这个问题的解决方法是:

将cmake building 目录下的"\include\dcmtk\config\osconfig.h"拷贝到自己工程的include下面 (覆盖之前从source里拷贝过来的的osconfig.h.)(building前是1KB, building后是27KB左右)

 

其中在新的iostream.h中有说明

/* DCMTK by default does not anymore pollute the default namespace by 

 * importing namespace std. Earlier releases did this to simplify compatibility 

 * with older compilers where STL classes were not consistently defined 

 * in namespace std. We now have configure macros which should care for this. 

 * If user code still relies on namespace std to be included, compile with 

 * macro USING_STD_NAMESPACE defined. 

 */

 

然后在Install说明文件中也有说明:

http://support.dcmtk.org/docs/file_install.html

 

   Visual C++ contains two different implementations of I/O streams which 

   should never be mixed within one application because this may cause 

   application errors that are hard to find.  The old, now deprecated 

   implementation uses the traditional cfront header files <iostream.h> etc. 

   The new implementation uses <iostream> etc. as defined in ANSI/ISO C++. 

   DCMTK can be configured to use either of the two interfaces.  This behaviour 

   can be changed in "include/dcmtk/config/osconfig.h" in the build directory 

   where the symbol USE_STD_CXX_INCLUDES is declared.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值