VS2010 c++ 错误的处理方法

来源:互联网 发布:淘宝米兰春天袜子? 编辑:程序博客网 时间:2024/05/21 14:52

1错误:

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

 

#include"StdAfx.h" 你把这个放在头文件里面就行了

2 vc++编程出现错误error C2447: missing function header (old-styleformal list?)

原因:函数后面多了分号;

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函数的定义不允许的

 

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

 

查看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字符

解决方法:

1、工程属性->配置属性–>常规—>字符集—->使用多字节符字符集

2、也就是宽字符,所以下面这行代码,应该编译有错误
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版本来编译的。
解决方法:
   1、首先查看编译项目依赖的其他项目的运行时库是否一致
   2、如果不一致,改为同样的运行时库,如在下编译的是:“多线程调试 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>头文件




转自

xlm289348的专栏

http://blog.csdn.net/xlm289348/article/details/7851654

0 0
原创粉丝点击