许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  Borland C++ 5.02 IDE中的bug(转载)

Borland C++ 5.02 IDE中的bug(转载)

阅读数 2
点赞 0
article_banner
  •   Borland C++ 5.02 IDE 中的 bug (转)[@more@]
     

Borland C++ 5.02 ide 中的一个 bug

from http://coneos.126.com

DarkSpy在Borland C++新闻组看到关于Borland C++ 5.02 IDE中的一个bug。

这个bug将会让编译器产生出错信息“(1,1) Bad object file record in module xxx near module offset 0x........”。

   DarkSpy也试验了一下,确实是一个问题。

如果有Borland C++的fans的话,也不妨试验一下,具体步骤如下。

建立一个工程,目标程序为MS-DOS程序,工程名字就叫tm_terror,

然后,建立一个头文件:terror.h,里面写上代码:

   #ifndef terr_h

   #define terr_h

namespace foo

   {

   template

   inline T absolute(T number)

   {

   if(number < T(0) ) return -number;

   return number;

   }

   }

#endif

然后,建立:terror.cpp,写上代码:

   #include "terror.h"

namespace foo2

   {

   using foo::absolute;

int do_test(int i)

   { return absolute(i); }

   }

然后,在工程文件:tm_terror.cpp中,写上代码:

   namespace foo2

   { int do_test(int); /* to spare a header, declaration */ }

int main()

   {

   return foo2::do_test(0);

   }

注意,工程中,terror.cpp必须要在tm_terror.cpp上面,不是的话则用alt+up键提上去。

然后,编译,你就会发现这个错误显示。:)

如何解决?

1) 在 template 中不要使用 "using namespace::name;" ,要用 "using namespace;";

   2) 在 IDE 中关闭 "Generate debug information" 选项。

虽然如此,Borland C++ 5.02 仍然不失为一款强劲的编译器,DarkSpy一直使用的就是这个。:)

DarkSpy 2001/6/3

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10748419/viewspace-1007457/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub. net /10748419/viewspace-1007457/


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删


相关文章
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空