1、error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
在項(xiàng)目屬性->Configration Properties->C/C++->Command Line頁(yè)面的Additional Options中加入/wd4430
2、error MSB3073: The command regsvr32 /s /c 解決辦法
最近將VC2002 代碼移植到VC2010,出現(xiàn)編譯錯(cuò)誤:
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設(shè)置為.ocx 或者.dll
Project->Configuration Properties->Linkerl->General ->Output File設(shè)置為$(OutDir)$(ProjectName)$(TargetExt)
中文版處理辦法:
在項(xiàng)目上點(diǎn)右鍵,選擇“屬性”->“配置屬性”->“常規(guī)”->“目標(biāo)文件擴(kuò)展名”,設(shè)置為.ocx 或者.dll
在項(xiàng)目上點(diǎn)右鍵,選擇“屬性”->“配置屬性”->“鏈接器”->“ 常規(guī) ”->“輸出文件”,設(shè)置為$(OutDir)$(ProjectName)$(TargetExt)
3、altdef.h 都是這個(gè)文件里的定義
#ifndef ATLTRY
#define ATLTRY(x) ATLTRYALLOC(x)
#endif //ATLTRY
出問(wèn)題的都是這個(gè)宏
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: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(954) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(970) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(970) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(995) : error C2712: 無(wú)法在要求對(duì)象展開(kāi)的函數(shù)中使用 __try
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1008) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1008) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1024) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1024) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1190) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlcomcli.h(1190) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(107) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(107) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(113) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(113) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(423) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(423) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(587) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(587) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(901) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(901) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(971) : error C2059: 語(yǔ)法錯(cuò)誤 : “catch”
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\statreg.h(971) : error C2143: 語(yǔ)法錯(cuò)誤 : 缺少“;”(在“{”的前面)
原來(lái)是工程屬性-〉預(yù)定義里的問(wèn)題,它在里面定義了try=_try,把這個(gè)刪除就OK了
4、
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)編譯錯(cuò)誤:
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設(shè)置為.ocx 或者.dll
Project->Configuration Properties->Linkerl->General ->Output File設(shè)置為$(OutDir)$(ProjectName)$(TargetExt)
中文版處理辦法:
在項(xiàng)目上點(diǎn)右鍵,選擇“屬性”->“配置屬性”->“常規(guī)”->“目標(biāo)文件擴(kuò)展名”,設(shè)置為.ocx 或者.dll
在項(xiàng)目上點(diǎn)右鍵,選擇“屬性”->“配置屬性”->“鏈接器”->“ 常規(guī) ”->“輸出文件”,設(shè)置為$(OutDir)$(ProjectName)$(TargetExt)
7、error D8016: '/ZI' and '/GL' command-line options are incompatible
把Debug調(diào)試項(xiàng)改為/ZI /Od
Project Settings 項(xiàng)->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無(wú)法注冊(cè)控件
depends.exe打開(kāi)要注冊(cè)的控件,找出這個(gè)控件所依賴(lài)的文件,缺少的文件在網(wǎng)上下載下來(lái),補(bǔ)上就可以了。
11、Graphedt.exe打開(kāi)后在任務(wù)欄里面有,但是點(diǎn)擊后無(wú)法顯示
打開(kāi)任務(wù)管理器,在應(yīng)用程序中找到Graphedt.exe,右擊選擇最大化就可以看見(jiàn)程序了。
12、開(kāi)機(jī)自啟動(dòng)的注冊(cè)表目錄:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run下面,如果要開(kāi)機(jī)啟動(dòng)某個(gè)程序,只要把這個(gè)程序的路徑下載這個(gè)位置就可以了。
13、彈出對(duì)話框“attempt an unsupport operation!”,是因?yàn)楸魂P(guān)聯(lián)的控件的ID號(hào)和DoDataExchange中的控件ID不同。
14、“Encountered an improper argument”,控件被刪除了,但是還有代碼對(duì)控件進(jìn)行操作而導(dǎo)致的
15、C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winioctl.h(39): error C2374: 'GUID_DEVINTERFACE_DISK' : redefinition; mult
重復(fù)包含了頭文件“winioctl.h”
16、error C2059: syntax error : 'catch'
右鍵點(diǎn)擊工程名,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 實(shí)務(wù)精選+源碼\DirectShow實(shí)務(wù)精選源碼\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 實(shí)務(wù)精選+源碼\DirectShow實(shí)務(wù)精選源碼\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)編譯錯(cuò)誤:
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設(shè)置為.ocx 或者.dll
Project->Configuration Properties->Linkerl->General ->Output File設(shè)置為$(OutDir)$(ProjectName)$(TargetExt)
中文版處理辦法:
在項(xiàng)目上點(diǎn)右鍵,選擇“屬性”->“配置屬性”->“常規(guī)”->“目標(biāo)文件擴(kuò)展名”,設(shè)置為.ocx 或者.dll
在項(xiàng)目上點(diǎn)右鍵,選擇“屬性”->“配置屬性”->“鏈接器”->“ 常規(guī) ”->“輸出文件”,設(shè)置為$(OutDir)$(ProjectName)$(TargetExt)
這個(gè)仍然不能解決的話就將“屬性”->“配置屬性”->“鏈接器”->Custom Build Step中的Command line,Description,Outputs都選為默認(rèn)值。即去除 不要自注冊(cè)。
19、error C2872: “CString”: 不明確的符號(hào)
DUILIB與MFC的結(jié)合
會(huì)產(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等。全工程替換。不過(guò)一分鐘的事。
3:不在MFC中使用 using namespace Duilib 在使用duilib時(shí)都加上Duilib::Crect。
20、關(guān)于這樣的錯(cuò)誤 libcpmtd.lib(string.obj) : error LNK2005: "public: void __thiscall
VC2008下 在一個(gè)動(dòng)態(tài)庫(kù)工程中, 改成了編程靜態(tài)庫(kù), 成功編譯, 但使用靜態(tài)庫(kù)的工程編譯時(shí)就出現(xiàn)下面一堆連接錯(cuò)誤.
經(jīng)過(guò)查找 解決方法如下:
說(shuō)是因?yàn)?Project->C/C++->Code Generation->Runtime Library 這個(gè)選項(xiàng),LIB和主程序(EXE)里選擇的不一致引起的。后來(lái)改成一樣就好了。
把exe工程 改為/MTD(因?yàn)長(zhǎng)ib工程是選擇/MTD的) 編譯還是錯(cuò)誤
于是 把EXE工程和Lib工程都選擇為/MDD 成功編譯
聯(lián)系客服