VC2005下的编译错误
2008-09-09 15:32
309 查看
1。
1>d:/study/vc2005/wmi/wmi/wmi.cpp(27) : error C2065: 'COINIT_MULTITHREADED' : undeclared identifier
1>d:/study/vc2005/wmi/wmi/wmi.cpp(27) : error C3861: 'CoInitializeEx': identifier not found
1>d:/study/vc2005/wmi/wmi/wmi.cpp(39) : error C2065: 'EOAC_NONE' : undeclared identifier
1>d:/study/vc2005/wmi/wmi/wmi.cpp(31) : error C3861: 'CoInitializeSecurity': identifier not found
1>d:/study/vc2005/wmi/wmi/wmi.cpp(69) : error C3861: 'CoSetProxyBlanket': identifier not found
是在调用com的函数库时出现的错误,下面的头文件和库已经导入
#include <objbase.h>
#pragma comment(lib, "ole32.lib")
解决方法:加入宏
#define _WIN32_WINNT 0x0400
#include <objbase.h>
#pragma comment(lib, "ole32.lib")
或者
#define _WIN32_DCOM
#include <comdef.h>
2。
error LNK2019: 无法解析的外部符号 "void __stdcall _com_issue_error(long)" (?_com_issue_error@@YGXJ@Z),该符号在函数 "public: __thiscall _bstr_t::_bstr_t(wchar_t const *)" (??0_bstr_t@@QAE@PB_W@Z) 中被引用
解决方法:加入头文件
#include <comdef.h>
3.d:/study/vc2005/event/event/basetoolbar.cpp(42) : error C2027: use of undefined type 'CDockBar'
查MSDN:
Compiler Error C2027
use of undefined type 'type'
A type cannot be used until it is defined. To resolve the error, be sure the type is fully defined before referencing it. The following sample generates C2027:
// C2027.cpp
class D;
/* resolve the error by defining the class
class D {
public:
void func() {
}
};
*/
int main() {
D *pD;
pD->func(); // C2027
}
解决方法:加入头文件
#include "afxpriv.h"
4.在目标机上发布错误
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
解决方法:
把Program Files/Microsoft Visual Studio 8/SDK/v2.0/BootStrapper/Packages/vcredist_x86/vcredist_x86.exe安装到目标机器上
1>d:/study/vc2005/wmi/wmi/wmi.cpp(27) : error C2065: 'COINIT_MULTITHREADED' : undeclared identifier
1>d:/study/vc2005/wmi/wmi/wmi.cpp(27) : error C3861: 'CoInitializeEx': identifier not found
1>d:/study/vc2005/wmi/wmi/wmi.cpp(39) : error C2065: 'EOAC_NONE' : undeclared identifier
1>d:/study/vc2005/wmi/wmi/wmi.cpp(31) : error C3861: 'CoInitializeSecurity': identifier not found
1>d:/study/vc2005/wmi/wmi/wmi.cpp(69) : error C3861: 'CoSetProxyBlanket': identifier not found
是在调用com的函数库时出现的错误,下面的头文件和库已经导入
#include <objbase.h>
#pragma comment(lib, "ole32.lib")
解决方法:加入宏
#define _WIN32_WINNT 0x0400
#include <objbase.h>
#pragma comment(lib, "ole32.lib")
或者
#define _WIN32_DCOM
#include <comdef.h>
2。
error LNK2019: 无法解析的外部符号 "void __stdcall _com_issue_error(long)" (?_com_issue_error@@YGXJ@Z),该符号在函数 "public: __thiscall _bstr_t::_bstr_t(wchar_t const *)" (??0_bstr_t@@QAE@PB_W@Z) 中被引用
解决方法:加入头文件
#include <comdef.h>
3.d:/study/vc2005/event/event/basetoolbar.cpp(42) : error C2027: use of undefined type 'CDockBar'
查MSDN:
Compiler Error C2027
use of undefined type 'type'
A type cannot be used until it is defined. To resolve the error, be sure the type is fully defined before referencing it. The following sample generates C2027:
// C2027.cpp
class D;
/* resolve the error by defining the class
class D {
public:
void func() {
}
};
*/
int main() {
D *pD;
pD->func(); // C2027
}
解决方法:加入头文件
#include "afxpriv.h"
4.在目标机上发布错误
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
解决方法:
把Program Files/Microsoft Visual Studio 8/SDK/v2.0/BootStrapper/Packages/vcredist_x86/vcredist_x86.exe安装到目标机器上
相关文章推荐
- VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPA
- VC 6.0工程转VC 2005工程的编译错误----消息处理宏
- VC编译错误: Nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12已经在dllmain.obj 中定义
- VC编译错误:msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class typ
- VC++ 2005编译链接错误汇总
- VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPA
- VC6调用VC2005编译生成的lib/dll库出现“unresolved external symbol "__declspec(dllimport) int __cdecl”错误的原因
- VC++ 2005编译链接错误汇总
- VC2005报告的template编译错误.....faint!
- (转+原)VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj) 中定义
- vc2010转化vc2005或低版本VC过程后,编译错误 解决方法
- VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj
- VC编译错误: Nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12已经在dllmain.obj 中定义
- VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPA
- VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPA
- VC++ 2005编译链接错误汇总
- vc2010转化vc2005或低版本VC过程后,编译错误 解决方法
- vc2010转化vc2005或低版本VC过程后,编译错误 解决方法
- 由vc2005 编译错误引出来的
- 使用VC2005编译出现这个错误