升级到VC2010的问题 [英] Problem with Upgrade to VC2010

查看:161
本文介绍了升级到VC2010的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010编译器进行编译器升级.现在,使用.NET 2003成功编译的我的代码在使用Visual Studio 2010构建时出现以下错误-

I doing compiler upgrade using Visual Studio 2010 compiler. My code which was compiled successfully using .NET 2003 now gives below error during build using Visual Studio 2010-

 

------构建开始:项目:< ProjectName> ;,配置:  Win32调试------

------ Build started: Project: <ProjectName>, Configuration:  Debug Win32 ------

1>   StdAfx.cpp

1>  StdAfx.cpp

1>   _WIN32_WINNT未定义.默认为_WIN32_WINNT_MAXVER(请参见WinSDKVer.h)

1>  _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)

1> C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ atlmfc \ include \ atlchecked.h(111):错误C2039:'_tcscpy_s':不是'`global namespace'的成员

1>C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlchecked.h(111): error C2039: '_tcscpy_s' : is not a member of '`global namespace''

1> C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ atlmfc \ include \ atlchecked.h(111):错误C3861:'_tcscpy_s':找不到标识符

1>C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlchecked.h(111): error C3861: '_tcscpy_s': identifier not found

1> C:\ Program Files \ Microsoft Visual Studio 10.0 \ VC \ atlmfc \ include \ atlchecked.h(138):错误C2039:'_tcsncpy_s':不是'`global namespace'的成员

1>C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\atlchecked.h(138): error C2039: '_tcsncpy_s' : is not a member of '`global namespace''

 

 

我尝试了很少的建议,但是这些建议并没有解决问题-

I tried few suggestions but those did not solve the issue-

1.包含的< windows.h>在stdafx.h中.包含后,出现错误,提示已包含windows.h.

1. Included <windows.h> in stdafx.h. Upon inclusion, it gave error that windows.h has already been included.

2.尝试将stdafx.h文件中的_WIN32_WINNT和WINVER定义为0x0502.

2. Tried defining _WIN32_WINNT and WINVER to 0x0502 in stdafx.h file.

3.尝试包含< TCHAR.h>

3. Tried including <TCHAR.h>

 

以上解决方案均未解决该问题.有人可以帮我吗?

None of the above solutions resolved the issue. Can somebody help me out.

 

感谢和问候,

Prafulla P. Ranadve

Prafulla P. Ranadve

推荐答案

如果包含tchar.h不能解决这个问题,那将是非常奇怪的事情.在VC10 SP1标头中,tchar.h具有

It would be extremly strange if including tchar.h didn't fix this. In the VC10 SP1 headers, tchar.h has

#define _tcscpy_s wcscpy_s

#define _tcscpy_s wcscpy_s

第384行,用于定义UNICODE的时间和

on line 384 for when UNICODE is defined and

#define _tcscpy_s strcpy_s

#define _tcscpy_s strcpy_s

,用于未定义UNICODE的情况.仔细检查一下.

on line 1039 for when UNICODE is not defined. Double check for yourself.

因此,请尝试包括tchar.h并完全重建项目,确保已删除所有目标文件甚至预编译的标头.

So try including tchar.h and doing a full rebuild of the project, making sure any object files and even the precompiled header have been deleated.

对于_WIN32_WINNT和WINVER的定义,您是否在stdafx.h的顶部定义了它们?需要在包含任何标题之前定义它们.

For the defining of _WIN32_WINNT and WINVER, did you define them right at the top of stdafx.h? These need to be defined before any headers have been included.


这篇关于升级到VC2010的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆