日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Vs2010編譯錯誤集

 safulo 2014-10-28

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

在項目屬性->Configration Properties->C/C++->Command Line頁面的Additional Options中加入/wd4430


2、error MSB3073: The command regsvr32 /s /c 解決辦法  

最近將VC2002 代碼移植到VC2010,出現(xiàn)編譯錯誤:

1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: The command "regsvr32 /s /c "D:\VC++Prj\source code\zutai\cha06\Meter\.\Debug\Meter.dll" 

1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: echo regsvr32 exec. time > ".\Debug\regsvr32.trg"

1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: :VCEnd" exited with code 3.

英文版處理辦法: 

Project->Configuration Properties->General->Target Extension設置為.ocx 或者.dll

Project->Configuration Properties->Linkerl->General ->Output File設置為$(OutDir)$(ProjectName)$(TargetExt)

中文版處理辦法: 

在項目上點右鍵,選擇“屬性”->“配置屬性”->“常規(guī)”->“目標文件擴展名”,設置為.ocx 或者.dll

在項目上點右鍵,選擇“屬性”->“配置屬性”->“鏈接器”->“ 常規(guī) ->“輸出文件”,設置為$(OutDir)$(ProjectName)$(TargetExt)

3、altdef.h 都是這個文件里的定義

#ifndef ATLTRY
#define ATLTRY(x) ATLTRYALLOC(x)
#endif //ATLTRY

出問題的都是這個宏
ATLTRY(szKey = new TCHAR[cbKey]);
ATLTRY(pszW.Allocate(_convert));
                  ATLTRY(szReg.Allocate(dwSize + 1));


1>FilterImageGrabber.cpp
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(954) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(954) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(970) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(970) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(995) : error C2712: 無法在要求對象展開的函數(shù)中使用 __try
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1008) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1008) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1024) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1024) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1190) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1190) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(107) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(107) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(113) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(113) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(423) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(423) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(587) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(587) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(901) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(901) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(971) : error C2059: 語法錯誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(971) : error C2143: 語法錯誤 : 缺少“;”(在“{”的前面)

 

原來是工程屬性-〉預定義里的問題,它在里面定義了try=_try,把這個刪除就OK了

 

4、

Error MSB3073 exited with code 3

The issue that causes "Error MSB3073 exited with code 3" happens to be with the VALUE in the Outputs property under Project > Properties > Configuration Properties > Custom Build Step.

When I choose Edit for Outputs, a dialog box comes up.  I enter a value of "$(OutDir)\regsvr32.trg" in the upper textbox then click OK.  Now for some reason VS 2010 changes the display text to show "$(OutDir)\regsvr32.trg;%(Outputs)".  I'm not sure why or if that is the cause of the problem.

However, I will get "Build Successful" if I change my Output value to "<inherit from parent or project defaults>" instead of choosing Edit and putting a value in.  No more Error MSB3073 exited with code 3.

I guess I can say this issue is resolved but I'd like to know why/what causes this issue to begin with.

 

5、 fatal error LNK1181: cannot open input file'largeint.lib'
在linker->Input->Additional Dependencies中去掉largeint.lib

6、error MSB3073
最近將VC2002 代碼移植到VC2010,出現(xiàn)編譯錯誤:
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: The command "regsvr32 /s /c "D:\VC++Prj\source code\zutai\cha06\Meter\.\Debug\Meter.dll"
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: echo regsvr32 exec. time > ".\Debug\regsvr32.trg"
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: :VCEnd" exited with code 3.
英文版處理辦法:
Project->Configuration Properties->General->Target Extension設置為.ocx 或者.dll
Project->Configuration Properties->Linkerl->General ->Output File設置為$(OutDir)$(ProjectName)$(TargetExt)
中文版處理辦法:
在項目上點右鍵,選擇“屬性”->“配置屬性”->“常規(guī)”->“目標文件擴展名”,設置為.ocx 或者.dll
在項目上點右鍵,選擇“屬性”->“配置屬性”->“鏈接器”->“ 常規(guī) ”->“輸出文件”,設置為$(OutDir)$(ProjectName)$(TargetExt)

 

 

7、error D8016: '/ZI' and '/GL' command-line options are incompatible

把Debug調(diào)試項改為/ZI /Od
Project Settings 項->C/C++ -> General

 

8、fatal error C1189: #error :  This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.

C/C++->Preprocessor->Preprocessor Definitions中的_WIN32_WINNT=0x0501改掉就可以了

 

9、C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlcomcli.h(1101): error C2059: syntax error : 'catch'
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlcomcli.h(1101): error C2143: syntax error : missing ';' before '{'


C/C++->Preprocessor->Preprocessor Definitions 下面的try=__try去掉。

 

10、regsvr32無法注冊控件
depends.exe打開要注冊的控件,找出這個控件所依賴的文件,缺少的文件在網(wǎng)上下載下來,補上就可以了。

11、Graphedt.exe打開后在任務欄里面有,但是點擊后無法顯示
打開任務管理器,在應用程序中找到Graphedt.exe,右擊選擇最大化就可以看見程序了。

12、開機自啟動的注冊表目錄:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run下面,如果要開機啟動某個程序,只要把這個程序的路徑下載這個位置就可以了。

13、彈出對話框“attempt an unsupport operation!”,是因為被關聯(lián)的控件的ID號和DoDataExchange中的控件ID不同。

14、“Encountered an improper argument”,控件被刪除了,但是還有代碼對控件進行操作而導致的

 

15、C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winioctl.h(39): error C2374: 'GUID_DEVINTERFACE_DISK' : redefinition; mult
重復包含了頭文件“winioctl.h”


16、error C2059: syntax error : 'catch'
右鍵點擊工程名,properties->Configuration Properties->C/C++->PreProcessor->Preprocessor Definitions中將try=__try去掉即可!


17、>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: The command "regsvr32 /s /c D:\DirectShow及協(xié)議資料\DirectShow 實務精選+源碼\DirectShow實務精選源碼\SourceCodes\Chapter03\VODDemo\FilterNetReceiver\.\Release\FilterNetReceiver.dll
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: echo regsvr32 exec.time > D:\DirectShow及協(xié)議資料\DirectShow 實務精選+源碼\DirectShow實務精選源碼\SourceCodes\Chapter03\VODDemo\FilterNetReceiver\Release\FilterNetReceiver.trg
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: :VCEnd" exited with code 3.


18、error MSB3073
最近將VC2002 代碼移植到VC2010,出現(xiàn)編譯錯誤:
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: The command "regsvr32 /s /c "D:\VC++Prj\source code\zutai\cha06\Meter\.\Debug\Meter.dll"
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: echo regsvr32 exec. time > ".\Debug\regsvr32.trg"
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: :VCEnd" exited with code 3.
英文版處理辦法:
Project->Configuration Properties->General->Target Extension設置為.ocx 或者.dll
Project->Configuration Properties->Linkerl->General ->Output File設置為$(OutDir)$(ProjectName)$(TargetExt)
中文版處理辦法:
在項目上點右鍵,選擇“屬性”->“配置屬性”->“常規(guī)”->“目標文件擴展名”,設置為.ocx 或者.dll
在項目上點右鍵,選擇“屬性”->“配置屬性”->“鏈接器”->“ 常規(guī) ”->“輸出文件”,設置為$(OutDir)$(ProjectName)$(TargetExt)

這個仍然不能解決的話就將“屬性”->“配置屬性”->“鏈接器”->Custom Build Step中的Command line,Description,Outputs都選為默認值。即去除  不要自注冊。



19、error C2872: “CString”: 不明確的符號 
 
DUILIB與MFC的結(jié)合
會產(chǎn)生Crect等沖突。
解決方法:
1:在stdafx.h中添加
#if USE(DuiLib)
#define  CRect DuiLib::CRect
#define  CPoint DuiLib::CPoint
#define  CSize DuiLib::CSize
#else
#define CRect ::CRect
#define  CPoint ::CPoint
#define  CSize ::CSize
#endif
在用的地方定義DuiLib
2:將duilib中的crect工程中全部改名Cduirect等。全工程替換。不過一分鐘的事。
3:不在MFC中使用 using namespace Duilib 在使用duilib時都加上Duilib::Crect。


20、關于這樣的錯誤 libcpmtd.lib(string.obj) : error LNK2005: "public: void __thiscall


VC2008下 在一個動態(tài)庫工程中, 改成了編程靜態(tài)庫, 成功編譯, 但使用靜態(tài)庫的工程編譯時就出現(xiàn)下面一堆連接錯誤.
 
經(jīng)過查找 解決方法如下:
說是因為 Project->C/C++->Code Generation->Runtime Library 這個選項,LIB和主程序(EXE)里選擇的不一致引起的。后來改成一樣就好了。
 
把exe工程 改為/MTD(因為Lib工程是選擇/MTD的) 編譯還是錯誤
于是 把EXE工程和Lib工程都選擇為/MDD 成功編譯

 

 

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多