VS 錯誤處理

1錯誤:ios

fatal error C1010: unexpected endof file while looking for precompiled header. Did you forget toadd '#include"StdAfx.h"' to your source?c++

 

#include"StdAfx.h" 你把這個放在頭文件裏面就好了編程

2 vc++編程出現錯誤error C2447: missing function header (old-styleformal list?)windows

緣由:函數後面多了分號;api

SUNSHINE_APISSN_RETURN SsnWriteProfileString(__in INT nPlugInId, __in_opt LPTSTRlpszGroupName, __in LPTSTR lpszKey, __in LPTSTR lpszValue)數組

 

3 errorC2491: 'SsnWriteProfileString' : definition of dllimport function not allowed多線程

錯誤C2491:「SsnWriteProfileString’:dllimport函數的定義不容許的less

 

SUNSHINE_API SSN_RETURNSsnWriteProfileString(__in INT nPlugInId, __in_opt LPTSTR lpszGroupName, __inLPTSTR lpszKey, __in LPTSTR lpszValue)ide

 

查看SUNSHINE_API在 .h文件中的定義函數

 

#ifdefSSNAPI_EXPORTS

#define SUNSHINE_API __declspec(dllexport)

#else

#define SUNSHINE_API __declspec(dllimport)

#endif

 

#ifdef SSNAPI_EXPORTS添加到#include<stdafx.h>的下面;形如:

 

#include<stdafx.h>

#defineSSNAPI_EXPORTS

則解決;

4 error C2065: 「CString」:未聲明的標識符

在非mfc下使用CString 會致使上面錯誤:

解決辦法:

(1)若是你使用VC.net那麼:使用MFC:包含cstringt.h;不使用MFC:包含atlstr.h

(2)或者 #include <afx.h>

error C2065: 'DEBUG_NEW' : undeclared identifier?

刪除 .cpp 文件中的

#ifdef _DEBUG

#undef THIS_FILE

static char THIS_FILE[]=__FILE__;

#define new DEBUG_NEW

#endif

6 問題:

error C2440: 'initializing' : cannot convert from 'constchar [34]' to 'TCHAR [128]'

錯誤C2440:「初始化」:不能把'字符常量[34]' ' TCHAR[128]'

緣由:編譯選項有沒有開了UNICODE;

作法:

vs2010下設置unicode編譯選項,去掉unicode模式,具體設置方法爲:

項目-》屬性-》配置屬性-》字符集-》未設置

 project->Properties->ConfigurationProperties->General->Character Set->Not Set

http://blog.csdn.net/hrh2010/article/details/6681271

7問題:

C1083:Cannot open include file: 'stdafx.h': No such file or directory

C1083:沒法打開包括文件:stdafx.h:沒有這樣的文件或目錄

解決:stdafx.h文件和工程的.h文件放在一個位置;

8 error C2065: 「cout」: 未聲明的標識符

解決方法:加上

#include   <iostream> 

using   namespace   std;

9 錯誤:

error C3872: '0x3000': thischaracter is not allowed in an identifier

錯誤C3872'0 X3000「:此字符不容許在標識符

0x3000是漢語的空格,也就是全角空格,至關於一個漢字,但你又看不見它。

你知道的,像逗號,有半角(,)和全角(,)之分的,其實空格也有。

0x3000是全角的空格,0x20是半角的空格。

你最好把這個語句的後面空白部分,都刪除掉,省得有不可見的全角空格。

10  加上 _T

error C2664: 'intswprintf_s(wchar_t *,size_t,const wchar_t *,...)' : cannot convert parameter 3from 'const char [24]' to 'const wchar_t *'

錯誤C2664:' int swprintf年代(wchar t *,大小t,t * wchar const,…)「:不能轉換參數3「const char[24]」「const wchar t *’

_stprintf_s(filename,MAX_PATH, _T("C:\\Program\\rwini_%d.ini"),nPlugInId);

_T("C:\\Program\\rwini_%d.ini")  至關於 LPTSTR

11沒法打開預編譯頭文件的解決方法

編輯程序,按Ctrl+F7,出現下列錯誤:

fatal error C1083: 沒法打開預編譯頭文件:「Debug/UGFace.pch」: No such file or  directory  

解決方法:修改:項目->屬性->C/C++->預編譯頭->不使用預編譯頭便可。

12

1>inifile.obj :error LNK2019: unresolved external symbol "private: __thiscallCsaveFileNameA::CsaveFileNameA(class CFileNameA *,classstd::basic_string<char,struct std::char_traits<char>,classstd::allocator<char>> const &)"(??0CsaveFileNameA@@AAE @PAVCFileNameA@@ABV?$basic_string@DU?$char_traits@D @std@@V?$allocator@D@2@@std@@@Z)referenced in function "public: class CsaveFileNameA * __thiscallCFileNameA::AddFileName(class std::basic_string<char,structstd::char_traits<char>,class std::allocator<char>>)"(?AddFileName@CFileNameA@@QAEPAVCsaveFileNameA@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

錯誤是CsaveFileNameA沒有實現,即沒有寫CsaveFileNameA構造函數和析構函數

13

1>e:\gc\src\core\inifile.h(344):error C2143: syntax error : missing ';' before '*'

錯誤緣由

CIniFileW*  PIniFile;應用的類在該類的下面,未定義;

classCFileNameW

{

public:

    staticconstwchar_t*const LF;

public:

    CFileNameW();

    ~CFileNameW();

 

    classCsaveFileNameW

    {

        friendclassCFileNameW;

#ifdef _WIN32

        // Added forversions earlier than VS2008

#ifdefined(_MSC_VER) && (_MSC_VER <= 1400)

        friendstructci_less_w;

#endif

#endif

    private:

        CsaveFileNameW( CFileNameW* pIniFile , const std::wstring& sFileName );

        CsaveFileNameW( constCsaveFileNameW& );// No Copy

        CsaveFileNameW&operator=(constCsaveFileNameW&);// No Copy

        ~CsaveFileNameW();

    private:

        CFileNameW* m_pIniFile;

        std::wstring m_sFileName;

        CIniFileW*  PIniFile;

    };

    structci_less_w

    {

        booloperator()(const CsaveFileNameW* s1,const CsaveFileNameW* s2)const

        {

#ifndef _WIN32

            returnwcscasecmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;

#else

            return_wcsicmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;

#endif

        }

    };

    typedefstd::set<CsaveFileNameW*,ci_less_w> FileIndexW;

 

#ifdef _WIN32

 

#ifdefined(_MSC_VER) && (_MSC_VER >= 1200)&& (_MSC_VER < 1300)

    friendclassCsaveFileNameW;

#endif

#endif

 

public:

    CsaveFileNameW* GetFileName( std::wstringsFileName );

    //CsaveFileNameW*GetFileName( std::wstring sFileName ) const;

    FileIndexW::const_iterator _find_file( const std::wstring& sFileName ) const;

    FileIndexW::iterator  _find_file( conststd::wstring& sFileName );

    voidRemoveAllFileNames( );

private:

    FileIndexW m_filenames;

 

};

classCIniFileW

{

public:

staticconstwchar_t* const LF;

public:

    CIniFileW();

    ~CIniFileW();

 

// Usedto save the data back to the file or your choice 

bool Save( conststd::wstring& fileName );

修改在前面加上 class CIniFileW

即爲:

classCIniFileW;

classCFileNameW

{

public:

    staticconstwchar_t*const LF;

public:

    CFileNameW();

    ~CFileNameW();

 

    classCsaveFileNameW

    {

        friendclassCFileNameW;

#ifdef _WIN32

        // Added forversions earlier than VS2008

#ifdefined(_MSC_VER) && (_MSC_VER <= 1400)

        friendstructci_less_w;

#endif

#endif

    private:

        CsaveFileNameW( CFileNameW* pIniFile , const std::wstring& sFileName );

        CsaveFileNameW( constCsaveFileNameW& );// No Copy

        CsaveFileNameW&operator=(constCsaveFileNameW&);// No Copy

        ~CsaveFileNameW();

    private:

        CFileNameW* m_pIniFile;

        std::wstring m_sFileName;

    public:

        CIniFileW*  PIniFile;

    };

    structci_less_w

    {

        booloperator()(const CsaveFileNameW* s1,const CsaveFileNameW* s2)const

        {

#ifndef _WIN32

            returnwcscasecmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;

#else

            return_wcsicmp(s1->m_sFileName.c_str(), s2->m_sFileName.c_str()) < 0;

#endif

        }

    };

    typedefstd::set<CsaveFileNameW*,ci_less_w> FileIndexW;

 

#ifdef _WIN32

 

#ifdefined(_MSC_VER) && (_MSC_VER >= 1200)&& (_MSC_VER < 1300)

    friendclassCsaveFileNameW;

#endif

#endif

 

public:

    CsaveFileNameW* GetFileName( std::wstringsFileName );

    //CsaveFileNameW*GetFileName( std::wstring sFileName ) const;

    FileIndexW::const_iterator _find_file( const std::wstring& sFileName ) const;

    FileIndexW::iterator  _find_file( conststd::wstring& sFileName );

    voidRemoveAllFileNames( );

private:

    FileIndexW m_filenames;

 

};

 

 

classCIniFileW

{

public:

staticconstwchar_t* const LF;

public:

    CIniFileW();

    ~CIniFileW();

 

// Usedto save the data back to the file or your choice 

bool Save( conststd::wstring& fileName );

 

14

error C2248:'CFileNameW::CsaveFileNameW::PIniFile' : cannot access privatemember declared in class 'CFileNameW::CsaveFileNameW'

錯誤C2248:「CFileNameW::::PIniFileCsaveFileNameW」:不能訪問私有成員中聲明的類的CFileNameW::CsaveFileNameW」

改正:把PIniFile改爲公有的;

public:

        CIniFileW*  PIniFile;

15 error C2440: 'initializing' : cannot convert from 'wchar_t *' to 'TCHAR'

修改前:

CString Description;
CString Ddvalue =_T("Command description");
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,Ddvalue, SSN_AUTO_SELECT_LOCALE,NULL,Ddvalue,Description.GetBuffer(), MAX_PATH,Ddvalue);
CString Hotkeys;
CString Hdvalue =_T("Hotkeys");
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,Hdvalue, SSN_AUTO_SELECT_LOCALE,NULL,Hdvalue,Hotkeys.GetBuffer(), MAX_PATH,Hdvalue);
TCHAR rgtsz[2][MAX_PATH]={Description.GetBuffer(),Hdvalue.GetBuffer()};

修改後:

      CString Description;
CString Ddvalue =_T("Command description");
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,Ddvalue, SSN_AUTO_SELECT_LOCALE,NULL,Ddvalue,Description.GetBuffer(), MAX_PATH,Ddvalue);
CString Hotkeys;
CString Hdvalue =_T("Hotkeys");
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,Hdvalue, SSN_AUTO_SELECT_LOCALE,NULL,Hdvalue,Hotkeys.GetBuffer(), MAX_PATH,Hdvalue);
TCHAR *rgtsz[2]={Description.GetBuffer(),Hdvalue.GetBuffer()};

給二維數組賦值;

16  warning C4627: '#include <math.h>': skipped when looking for precompiled header use

 解決方法:加上頭文件#include "stdafx.h" 

17

CString與char的轉換問題,用強制轉換報了以下錯誤,應該如何進行轉換呢?

CString   strName;

TCItem.item.pszText= "ok ";//顯示正常
TCItem.item.pszText=(char)strName;//報以下錯誤

error   C2440:    'type   cast '   :   cannot   convert   from    'class   CString '   to    'char '
                         No   user-defined-conversion   operator   available   that   can   perform   this   conversion,   or   the   operator   cannot   be   called
Error   executing   cl.exe.

解決方法:

(char   *)&strName

 

18  關於VC 的 error C3872: '0x3000':

今天在網上看到了些技術代碼(關於按鈕動態生成菜單的代碼.好象都是一我的寫的吧.幾乎都沒有什麼變化),因而邊拷貝代碼邊測試執行程序的結果,想不到碰到了麻煩,簡單的兩行代碼執行時竟然出了十多行的error提示:

Error 1 error C3872: '0x3000': this character is not allowed in an identifier

  可是看上去代碼明明是對的,沒錯啊!因而雙擊提示查看是哪裏出的錯,結果光標停在了一行註釋上,那是一塊兒拷貝進來的一些註釋文字。想一想也沒用,刪除,再運行,結果程序順利執行完畢了。

  後來發現是一些網頁上的非正常格式的空格在作怪,應該是字符碼的問題,它與VS中的字符不兼容,因此VS編譯程序時沒法識別此類字符串,因而報錯。

註釋有的時候就出現莫名其妙的問題..............

 19  iostream 的用法,頭文件後面不能加.h

#include<iostream>
using namespace std;

 20 error LNK2005: "int __cdecl PiShowListDialog(struct _SSN_OBJECT_ID_,struct _SSN_OBJECT_ID_)" (?PiShowListDialog@@YAHU_SSN_OBJECT_ID_@@0@Z) already defined in DlgDefaultList.obj

錯誤表明同一個工程裏,有兩個PiShowListDialog函數!

21

致命錯誤C1010:在尋找預編譯指示頭文件時,文件未預期結束。

 就是沒有找到預編譯指示信息的頭文件。  問題通常發生在:經過添加文件的方式,添加了一些cpp文件到一個MFC的程序,但該cpp文件並非MFC,而是標準的C++。   解決方案1: 右鍵單擊項目工程中的cpp文件,在菜單Project->Settings->C/C++->Precompile Header,設置爲第一項:Not using precompile headers。  解決方案2:在.cpp文件開頭添加包含文件stdafx.h。 #include"stdafx.h"

22 error C2664: 「LoadLibraryW」: 不能將參數 1 從「const char *」轉換爲「LPCWSTR」

1 靜態調用DLL
Project | setting
Link選項卡Library modules處
添加「XXX.lib」
而後#include 「XXX.h」
把XXX.lib(引入庫文件),XXX.DLL(動態庫文件)
XXX.h(頭文件)
所有放到工程目錄下

2 動態調用DLL
經過
LoadLibrary
GetProcAddress
FreeLibrary實現。

緣由 :工程只支持UNICODE字符

解決方法:

一、工程屬性->配置屬性–>常規—>字符集—->使用多字節符字符集

二、也就是寬字符,因此下面這行代碼,應該編譯有錯誤
hinst=LoadLibrary(「InTheHand.Net.Personal.dll」);
也就是:
cannot convert parameter 1 from ‘char [27]‘ to ‘const unsigned short *’
樓主將代碼改成:
hinst=LoadLibrary(L」InTheHand.Net.Personal.dll」);
或者
hinst=LoadLibrary(_T(「InTheHand.Net.Personal.dll」));
試試

 22

 warning C6387: 'argument 1' might be '0': this does not adhere to the specification for the function 'GlobalLock': Lines: 328, 329, 330, 332, 333, 334, 335

就是未對輸入是否爲空,進行判斷!

 23

AfxMessageBox(("click"));

錯誤 error C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types

解決方法:
AfxMessageBox(_T("click"));

解釋:若是程序中define   _UNICODE,則可用_T   or   _TEXT將後面的內容轉爲UNICODE格式字符串,不然和不用_T同樣

或者就修改項目屬性裏面的字符編碼 

24 LNK2005: "class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > NextSpeakString" (?NextSpeakString@@3V?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@A) already defined in Speech.obj

解決方案:變量或者函數的定義放到cpp文件中,不要放到.h中~

25 :\ceshi\fuzzysearch\fuzzysearch\fuzzysearch\fuzzysearch.cpp(46): error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::istream' (or there is no acceptable conversion)

老是提示這樣的錯誤,修改方法:

(1)加上頭文件#include <string>

(2)檢查類型:

TCHAR* argv[100];
std::cout<<"輸入數組大小"<<endl;
std::cin>> argc;
std::cout<<"輸入數組內數據"<<endl;
for(int j=0;j<argc;j++)
{  
std::cin>>argv[j];
}

則提示錯誤,應該改爲:  char* argv[100]; 則再也不提示此錯誤;

常見編譯/連接錯誤及其解決辦法

轉自:http://blog.csdn.net/powerlly/article/details/4409592

1. 解決error LNK2005: ___crtExitProcess 已經在 LIBCMTD.lib(crt0dat.obj) 中定義

有的時候, 在 Debug 模式下編譯沒問題, 換到 Release 模式就發生一堆問題.

典型的例子, 就是因為 c++ runtime library 設定不一樣, 所形成的重複定義連結錯誤.
而另外一個常見的例子是 專案與 library 使用不一樣的字元集合設定
(如: 一個用 Unicode Character Set, 另外一個用 Multi-Byte Character Set)

這個錯誤
發生緣由, 有多是
1. 你 link 的 lib 使用 C++ Multi-threaded DLL (/MD)
2. 而你的 source 使用的 C++ runtime library 是 Multi-threaded (/MT)
導致重複定義

解決方法:
兩個使用相同的 C++ runtime library.
例如都使用 static 的 Multi-threaded (/MT).


2. 錯誤 1 error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) 已經在 LIBCMT.lib(typinfo.obj) 中定義 MSVCRTD.lib

項目 -> 屬性 -> c/C++  -> 代碼生成  -> 運行時庫  設置爲: 多線程調試 DLL (/MDd) 
被引用的庫和調用的程序編譯選項不一樣,須要改爲一致後編譯


3. #pragma once與 #ifndef的區別
爲了不同一個文件被include屢次
1   #ifndef方式
2   #pragma once方式
在可以支持這兩種方式的編譯器上,兩者並無太大的區別,可是二者仍然仍是有一些細微的區別。
    方式一: 
    #ifndef __SOMEFILE_H__
    #define __SOMEFILE_H__
    ... ... // 一些聲明語句
    #endif

    方式二:
    #pragma once
    ... ... // 一些聲明語句
    #ifndef的方式依賴於宏名字不能衝突,這不光能夠保證同一個文件不會被包含屢次,也能保證內容徹底相同的兩個文件不會被不當心同時包含。固然,缺點就是若是不一樣頭文件的宏名不當心「撞車」,可能就會致使頭文件明明存在,編譯器卻硬說找不到聲明的情況
    #pragma once則由編譯器提供保證:同一個文件不會被包含屢次。注意這裏所說的「同一個文件」是指物理上的一個文件,而不是指內容相同的兩個文件。帶來的好處是,你沒必要再費勁想個宏名了,固然也就不會出現宏名碰撞引起的奇怪問題。對應的缺點就是若是某個頭文件有多份拷貝,本方法不能保證他們不被重複包含。固然,相比宏名碰撞引起的「找不到聲明」的問題,重複包含更容易被發現並修正。
   方式一由語言支持因此移植性好,方式二 能夠避免名字衝突

 

4. error LNK2019: 沒法解析的外部符號 __imp__PathCombineW
PathCombine是Shell api須要引入庫
#pragma comment( lib, "shlwapi.lib")

 

5.  error C2662: "MyClass::GetName()」: 不能將「this」指針從「const MyClass」轉換爲「MyClass &」 
bool MyClass::operator==(const MyClass* n1) const
{
 return GetName() == n1->GetName();
}
緣由是不能在const函數中調用對象的非const方法,MyClass中的GetName()必須是const的。


6. template 模板
搞死了

模板聲明和定義必須在同一個文件中,並且只有實例話模板類型時才編譯模板實例

 

7. error C2275: 「MyClass」: 將此類型用做表達式非法 MyClass.Instance();
 緣由:Instance是靜態方法,用.引用會出錯。應該是MyClass::Instance()

 

8. error LNK2019: 沒法解析的外部符號 "public: __thiscall MyClass(void)
緣由:只聲明瞭構造函數,MyClass(); ,但未定義。 能夠定義空函數,或者直接註釋掉,使用默認構造函數。

 

9.  error C2504: 「testing」: 未定義基類 
class PackToolTest : testing.Test {}
緣由:Test是testing命名空間下的一個類,須要用域操做符,testing::Test
還有一個問題,缺乏基類繼承權限(public、protected、private)

 

10. error C2864: 「MyClass::_nullpack」: 只有靜態常量整型數據成員才能夠在類中初始化  
class MyClass {

      string _nullpack = "test";

}

緣由:c++ 中,成員變量不能在聲明時初始化,而是在構造函數初始化列表中先初始化

 

11. error LNK2019: 沒法解析的外部符號 _WinMain@16 int main()
緣由:因爲建立的是Win32 Project,和Win32 console Project的連接庫不一樣
方法1:在程序最開始的地方加上如下語句 
#pragma   comment(linker,   "/subsystem:console ") 
方法2:project   > >   setting   > >   在link   的project   options   中將/subsystem:windows(console)刪了 

 

12.相似「已經在 msvcprtd.lib(MSVCP80D.dll) 中定義」問題
vs2005 Debug /Release須要分別配製

分析一下錯誤來源,會發現:
1.     錯誤來源主要是重複定義的問題,並且重複定義的基本上都是VC Runtime和Standard C++ Library中的函數
2.     LIBCMT和LIBCPMT爲Release下的Lib,原本不該該出如今Debug版本的連接的Lib中
3.     重複定義的問題主要出如今:LIBCMT, LIBCPMT, MSVCPRTD, MSVCRTD
來看看出問題的LIB是那些:
1.     LIBCMT:C Runtime庫的多線程靜態連接的Release版本
2.     LIBCPMT:C++ Standard Library的多線程靜態連接的Release版本
3.     MSVCPRTD:C++ Standard Library的多線程DLL的Debug版本
4.     MSVCRTD:C Runtime Library的多線程DLL的Debug版本
當前咱們的配置是多線程DLL的Debug版,所以3和4是應該出如今link的列表中的,不屬於多餘。然後二者則是隻是當多線程靜態連接Release 版中才會出現。這提示我在項目中加入的ANTLR.LIB多是形成這個問題的根源,由於靜態庫的編譯選項很容易和主程序發生衝突,而且根據實際信息咱們 能夠看出ANTLR.LIB應該是用多線程靜態連接的Release版原本編譯的。
解決方法:
   一、首先查看編譯項目依賴的其餘項目的運行時庫是否一致
   二、若是不一致,改成一樣的運行時庫,如在下編譯的是:「多線程調試 DLL (/MDd)」,如今須要把全部的依賴項目的運行時庫都改成一致的庫,就OK了。

 

13.  error C2143: 語法錯誤 : 缺乏「;」(在「*」的前面)
緣由:產生錯誤處,某類型未include,可能頭文件名拼寫錯誤、頭文件名已更改

 

14. error C2572: 「MyClass::Invoke」: 重定義默認參數 : 參數 2 
string MyClass::Invoke(const CParam& paraObj, INVOKETYPE type = ASYN)

緣由:默認參數,只需在聲明時指定。方法定義的時候無需指定默認參數。
string MyClass::Invoke(const CParam& paraObj, INVOKETYPE type /*= ASYN*/)

{ ... }

 

15. 錯誤 C2558 沒有可用的複製構造函數或複製構造函數聲明爲「explicit」
試圖複製其複製構造函數爲 private 的類。在大多數狀況下,不該複製具備 private 複製構造函數的類。通用編程技術聲明 private 複製構造函數以防止直接使用類。該類自己可能無用,或須要另外一個類才能正常工做。

嘗試複製其複製構造函數爲 explicit 的類。用 explicit 聲明覆制構造函數會阻止將類的對象傳遞到函數或從函數返回類的對象。

緣由: 拷貝構造函數、賦值函數參數必須用const修飾

 

16. 不能建立抽象類對象
緣由: 1. 存在虛函數未實現; 2. 因爲疏忽重載虛函數格式錯誤(此問題須要仔細檢查才能發現); 3. 虛函數名稱與系統中已有的虛函數重名,致使重載失敗(這點很納悶)。

 

17. 沒有找到MSCRV80D.dll

工程屬性: 配置類型 由 exe 改爲 lib 後生成, 而後再改回來
運行時會出現 「沒有找到MSCRV80D.dll」 的異常

解決方法: 
工程屬性:MFC的使用 由 「使用標準Windows庫」 改爲 「在靜態庫中使用MFC「 生成 ,而後再改回來
生成、運行 OK

 

18. CVTRES : fatal error CVT1100: 重複的資源。type:MANIFEST, name:1, language:0x0409
另外一個則提示爲:
LINK : fatal error LNK1123: 轉換到 COFF 期間失敗: 文件無效或損壞

已經到了連接期,應該說,問題就不像編譯通不過那麼彆扭了,而查閱MSDN關於這兩個問題的說明,終於找到了解決的方法,現簡單的陳述以下:
首先,出現這兩個問題的緣由都是一個,即文件中的現有資源文件和新資源字符串表 ID 衝突。微軟也給出瞭解決這個問題的方法,可是,在現有的狀況下,這個方法是靠不住的,由於,不可能不使用wx.rc資源。因此,一個變通的解決方法就是:
工程屬性->配置屬性-> 清單工具->輸入和輸出->嵌入清單,選擇[否],便可。

19 

1>c:\program files\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::wstring' 

提示以上錯誤,則應該加上#include <string>頭文件

相關文章
相關標籤/搜索