VC2005下的编译错误

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安装到目标机器上
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值