'HCRYPTHASH' : undeclared identifier 类似错误的解决办法
2011-02-23 23:52
363 查看
在编译一个cpp程序时,明明已经 include <wincrypt.h>,可还是报错 D:\crypt\crypt.cpp(20) : error C2065: 'HCRYPTHASH' : undeclared identifier D:\crypt\crypt.cpp(20) : error C2146: syntax error : missing ';' before identifier 'hHash' D:\crypt\crypt.cpp(20) : error C2065: 'hHash' : undeclared identifier D:\crypt\crypt.cpp(22) : error C2065: 'HCRYPTKEY' : undeclared identifier D:\crypt\crypt.cpp(22) : error C2146: syntax error : missing ';' before identifier 'hKey' D:\crypt\crypt.cpp(22) : error C2065: 'hKey' : undeclared identifier D:\crypt\crypt.cpp(24) : error C2065: 'HCRYPTPROV' : undeclared identifier D:\crypt\crypt.cpp(24) : error C2146: syntax error : missing ';' before identifier 'hProv' D:\crypt\crypt.cpp(24) : error C2065: 'hProv' : undeclared identifier D:\crypt\crypt.cpp(32) : error C2065: 'CryptAcquireContext' : undeclared identifier D:\crypt\crypt.cpp(38) : error C2065: 'CryptCreateHash' : undeclared identifier D:\crypt\crypt.cpp(54) : error C2065: 'CryptHashData' : undeclared identifier D:\crypt\crypt.cpp(70) : error C2065: 'CryptDeriveKey' : undeclared identifier D:\crypt\crypt.cpp(105) : error C2065: 'CryptEncrypt' : undeclared identifier D:\crypt\crypt.cpp(151) : error C2065: 'CryptDestroyHash' : undeclared identifier D:\crypt\crypt.cpp(157) : error C2065: 'CryptDestroyKey' : undeclared identifier 原因是: vc6缺省是不定义_WIN32_WINNT宏的。 而在wincrypt.h中有 #if (_WIN32_WINNT >= 0x0400) ... #endif 解决办法是: 在stdafx.h中添加 #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #endif |
相关文章推荐
- 'HCRYPTHASH' : undeclared identifier 类似错误的解决办法
- 'HCRYPTHASH' : undeclared identifier 类似错误的解决办法
- error C2065: 'AfxCriticalTerm' : undeclared identifier 解决办法
- VS2008下编译错误(error C2065: '_S1max' : undeclared identifier)的解决办法
- 解决 “错误3 :error MSB4036: 未找“SetEnvironmentVariable”任务。” 类似错误的一个办法
- select into from 提示 Undeclared variable.....错误的解决办法
- 类型转换错误类似java.math.BigDecimal cannot be cast to java.lang.Double 解决办法
- MySql 数据库导入"Unknown command '\n'."错误解决办法
- MySql 数据库导入"Unknown command '\n'."错误解决办法
- Validation (): Element ' ' is not supported错误的解决办法
- 解决error while loading shared libraries: xxx.so.x"类似问题办法和错误原因
- jsp&servlet报红线javax.servlet.jsp.XXXX cannot be resolved to a type类似错误解决办法
- 加string.h后出现string' : undeclared identifier的解决办法
- vxworks parse error near int类似错误的解决办法
- 安装iis打开网站提示Microsoft JET Database Engine 错误 '80004005'解决办法
- LWA_COLORKEY undeclared identifier 的解决办法
- msxml3.dll 错误 '800c0005'终极解决办法
- python UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2: ordinal not in range(128)错误解决办法
- IIS8/IIS7/IIS6 出现ADODB.Connection 错误 '800a0e7a'的解决办法
- oracle错误(三) ORA-00972 identifier is too long 的解决办法