Borland C++ 5.02 IDE 中的 bug (轉)
Borland C++ 5.02 中的一個
from
DarkSpy在Borland C++新聞組看到關於Borland C++ 5.02 IDE中的一個bug。
這個bug將會讓產生出錯資訊“(1,1) Bad 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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Borland C++ Builder的API後門 (轉)C++UIAPI
- Borland IDE 常用熱鍵簡介 v0.1 (轉)IDE
- borland c++ bulder的檔案操作總結-2 (轉)C++
- borland c++ bulder的檔案操作總結-1 (轉)C++
- borland c++ bulder的檔案操作總結-3 (轉)C++
- borland c++ bulder的檔案操作總結-4 (轉)C++
- Bye Delphi!Borland要賣掉他的IDE業務了IDE
- 壯士斷腕,Borland出售其IDE業務IDE
- Borland C++ Builder 5 企業版使用BDE訪問 Oracle方法 (轉)C++UIOracle
- Borland C++ 6安裝Indy9C++
- [轉]C,C++開源專案中的100個BugsC++
- ubuntu c/c++ IDE程式設計環境(轉)UbuntuC++IDE程式設計
- Borland與Microsoft關於Delphi的對話 (轉)ROS
- C++ Builder 5 和 6中VCL的一個記憶體洩漏 BUG (轉)C++UI記憶體
- Borland 關注Java和.NET之間的裂口 (轉)Java
- C++中的模板(templates) (轉)C++
- Borland C++Builder .RES 中文化 (轉)C++UI
- C++中的輾轉相除法C++
- Redis 5.02官方叢集搭建Redis
- Borland推出全新Linux開發工具Kylix (轉)Linux
- Delphi 6 SOAP 原始碼中的BUG修正 (轉)原始碼
- ASP中令人震撼的Debug類(VBScript) (轉)
- 玩轉BCB的IDE,體驗ToolsAPI (轉)IDEAPI
- c++ builder中的ado使用 (轉)C++UI
- C++中的預處理(上) (轉)C++
- C++中的預處理(下) (轉)C++
- SAP與Borland合作 ,整合JAVA開發環境 (轉)Java開發環境
- Delphi中兩個BUG的分析與修復 (轉)
- Borland JBuiler X(10) ?UI
- C/C++ debug(一)C++
- c++中數字和字串的轉換C++字串
- C++ 表示式中的型別轉換C++型別
- Visual C++中的圖形特技 (轉)C++
- C++中類及類的定義 (轉)C++
- VCL 中的一個記憶體洩漏 Bug (轉)記憶體
- Borland 賣掉 CodeGear
- 介面在託管C++中的應用 (轉)C++
- C與C++中的異常處理 (轉)C++