vc文件include建議

#include最好放在

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

 前面,避免不必要的錯誤;

例:

d:\VS2003\Vc7\include\xdebug(29)   :   warning   C4229:   使用了記時錯誤   :   忽略數據上的修飾符 
d:\VS2003\Vc7\include\xdebug(29)   :   error   C2365:   “new”   :   重定義;以前的定義是“成員函數”
d:\VS2003\Vc7\include\xdebug(29)   :   error   C2491:   “new”   :   不允許   dllimport   數據   的定義 
d:\VS2003\Vc7\include\xdebug(29)   :   error   C2078:   初始值設定項太多 
d:\VS2003\Vc7\include\xdebug(29)   :   error   C2440:   “初始化”   :   無法從“int”轉換爲“void   *” 
                從整型轉換爲指針類型要求   reinterpret_cast、C   樣式轉換或函數樣式轉換 
d:\VS2003\Vc7\include\xdebug(29)   :   error   C2143:   語法錯誤   :   缺少“;”(在“(”的前面) 
d:\VS2003\Vc7\include\xdebug(29)   :   error   C2226:   語法錯誤   :   意外的“size_t”類型 
d:\VS2003\Vc7\include\xdebug(30)   :   error   C2059:   語法錯誤   :   “)” 
d:\VS2003\Vc7\include\xdebug(33)   :   warning   C4229:   使用了記時錯誤   :   忽略數據上的修飾符 
d:\VS2003\Vc7\include\xdebug(33)   :   error   C2365:   “new”   :   重定義;以前的定義是“成員函數”
d:\VS2003\Vc7\include\xdebug(33)   :   error   C2491:   “new”   :   不允許   dllimport   數據   的定義 
d:\VS2003\Vc7\include\xdebug(33)   :   error   C2078:   初始值設定項太多 
d:\VS2003\Vc7\include\xdebug(33)   :   error   C2440:   “初始化”   :   無法從“int”轉換爲“void   *” 
                從整型轉換爲指針類型要求   reinterpret_cast、C   樣式轉換或函數樣式轉換 
d:\VS2003\Vc7\include\xdebug(33)   :   error   C2143:   語法錯誤   :   缺少“;”(在“[”的前面) 
d:\VS2003\Vc7\include\xdebug(33)   :   error   C3409:   不允許空屬性塊 
d:\VS2003\Vc7\include\xdebug(34)   :   warning   C4091:   “”   :   沒有聲明變量時忽略“unsigned   int”的左側 
d:\VS2003\Vc7\include\xdebug(34)   :   error   C2143:   語法錯誤   :   缺少“;”(在“,”的前面) 
d:\VS2003\Vc7\include\xdebug(34)   :   error   C2059:   語法錯誤   :   “,” 
d:\VS2003\Vc7\include\xdebug(34)   :   fatal   error   C1004:   遇到意外的文件結束 
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章