c='/0*ab' c语言,VC编译错误:error C2065: 'strcpy_instead_use_StringCbCopyA_or_StringCchCopyA&#039...

经过尝试 第一种方法为我解决了问题 其它并没有

但是确实是direct sdk的问题 最后一种是更改函数,但是相对麻烦,因为参数也将修改。

一:

今天想看一个人的VC的源码。今天开发报错:err C2065:

"sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA" :

undeclared identifer.

不知道何解,最终在一个韩国的博客找了解决版本

Project >Settings > C/C++

> Gerneral > Preprocessor definitions

STRSAFE_NO_DEPRECATE

后记,为了这个VC的源码,我装了VC6+DirectX

SDK9(extra)(dshow.h缺失要求的)+Platform SDK(strsafe.h No such file or

directory)

发现安装DirectX SDK9跟Platform SDK core

SDK效果一样里面都有strsafe.h这个库。

注:我是使用第一种方法,在workspace里选择出错的工程,然后照着上面添加STRSAFE_NO_DEPRECATE

字段,重新编译就OK了。

二:

C:\Documents and

Settings\Administrator\桌面\Chapter07\DsDemo\DsDemoDlg.cpp(196) :

error C2065: 'strcpy_instead_use_StringCbCopyA_or_StringCchCopyA' :

undeclared identifier

C:\Documents and

Settings\Administrator\桌面\Chapter07\DsDemo\DsDemoDlg.cpp(197) :

error C2065: 'strcat_instead_use_StringCbCatA_or_StringCchCatA' :

undeclared identifier

解决方法:在包含direct

sdk的头文件之前加上#include

这样一来,会出现重复定义的报警信息,解决方法如下:

#pragma warning( disable : 4996

)

#include

#pragma warning( default : 4996

)

三:

hi~

I have installed visual studio 6.0,

DirectX 8.1 sdk, msxml 4.0, psdk windows server 2003 sp1 in my

system.(os : window xp professional)

When I compile my application.I am

getting a lot of errors.

" error C2065:

'strcpy_instead_use_StringCbCopyA_or_StringCchCopyA' : undeclared

identifier "

Tools->Options->Show

directories

1. platform sdk

include

2. dxsdk8.1 include

3. msxml4.0 include

4. visual studio include

Thank you for the help,

feel

Without a code sample it is really hard to

speculate what is happening.

All what I can find is that

inPlatformSDK\include\strsafe.hyou

will find:#define

strcpy strcpy_instead_use_StringCbCopyA_or_StringCchCopyA;

May be it is the order you are

including the header files or the mix.

Try generating a

proprocessed version of he file reporting the errors and take a

look at this file. You can use the /P compiler option to generate

such a preprocessed version.

Hope this helps!

Thanks,

Ayman

Shoukry

VC++

Team

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值