天天看點

VS2008常見問題解決方案

 fatal error CVT1100

>CVTRES : fatal error CVT1100: duplicateresource.  type:DIALOG, name:510,language:0x0804

這句話的意思是資源ID為510的DIALOG重複定義了,在resource.h中查找資源ID為510的資源辨別IDD_AXESDLG,全工程搜尋該資源辨別IDD_AXESDLG,删除重複定義的DIALOG.

Error C2143:

error C2143: syntax error : missing ','before '&'

定位出錯語句:

staticbool  AddFPReport(conststd::string&lstrURL,constCRmcpFPReport&lcFPReport);

原理分析:

并不是錯誤資訊所說的那樣要在&号前加一個分号,而是程式不認識CRmcpFPReport這個類。

解決方法:加入CRmcpFPReport類所頭檔案#include"shareHead.h"

補充:

.\檔案所在目前檔案夾,一個點代表檔案所在目前檔案夾

..\檔案所在檔案夾上一級檔案夾,兩個點檔案所在檔案夾的上一級檔案夾

Error C2653:

error C2653: 'RTK' : is not a class ornamespace name

解析:引入了檔案夾之後,如果要使用某個類,還需要引入該類所在頭檔案。

Error C4430:

error C4430: missing type specifier - intassumed. Note: C++ does not support default-int

這是因為在VC6中,如果沒有顯示的指定傳回值類型,編譯器将其視為預設整型。但是vs2005不支援預設整型。

解決方法如下:

打開:項目----項目屬性----配置屬性----C/C++----指令行,在附加選項那裡添加/wd4430這個選項。

warning C4627

warning C4627: '#include"BsdmexserviceH.h"': skipped when looking for precompiled header use

1>         Add directive to 'stdafx.h'or rebuild precompiled header

解決方案:

在.CPP檔案中,添加“stdafx.h”,而且該頭檔案一定要加到最前面。

error C2248:

1>d:\program files\microsoft visual studio9.0\vc\atlmfc\include\afxwin.h(1936) : error C2248: 'CObject::CObject' : cannotaccess private member declared in class 'CObject'

1>       d:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h(561): see declaration of 'CObject::CObject'

1>       d:\program files\microsoft visual studio9.0\vc\atlmfc\include\afx.h(532) : see declaration of 'CObject'

1>                        This diagnostic occurred inthe compiler generated function 'CCmdTarget::CCmdTarget(const CCmdTarget &)

解決方法:

SYSTEMTIME GetTime(CMyDateTimeCtrldateStart,CMyDateTimeCtrl timeStart);

改為:

SYSTEMTIME GetTime(CMyDateTimeCtrl *dateStart,CMyDateTimeCtrl*timeStart);

繼續閱讀