在VC ++ 6.0中使用CString :: AllocSysString时链接错误

时间:2013-01-13 07:10:17

标签: c++ mfc

添加了以下代码

BSTR pbstrBuffer;
pbstrBuffer = buff.AllocSysString();

构建项目时出现以下错误:

Linking...
  Creating library pcciortl.lib and object pcciortl.exp .obj : error LNK2001: unresolved external symbol "public: unsigned short  * __thiscall CString::AllocSysString(void)const " (?AllocSysString@CString@@QBEPAGXZ)

c:\ pct3 / pcciortl.dll:致命错误LNK1120:1个未解析的外部 执行link.exe时出错。

其他CString方法似乎没问题。我该怎么办?

1 个答案:

答案 0 :(得分:0)

找到手动包含mfco42d.lib的解决方案,然后找出真正的解决方案,在项目中包含一个MFC包含文件

#include <afxole.h>         // MFC OLE classes
#include <afxdisp.h>        // MFC OLE automation classes

它的作用是在Visual C ++ 6.0中包含库mfco42d.lib

相关问题