经过尝试 第一种方法为我解决了问题 其它并没有
但是确实是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