繁体   English   中英

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

[英]Link errors while using CString::AllocSysString in VC++ 6.0

添加了以下代码

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方法似乎还可以。 我该怎么办?

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM