当代明月分享 http://blog.sciencenet.cn/u/chenfanglin

博文

comutil.h; ConvertStringToBSTR; error LNK2001

已有 9119 次阅读 2007-8-22 10:33 |个人分类:VC

用ConvertStringToBSTR需要include进:comutil.h。在debug模式下,build没有问题。但在release模式下,出现如下问题:

Error 1 error LNK2001: unresolved external symbol "wchar_t * __stdcall _com_util::ConvertStringToBSTR(char const *)" (?ConvertStringToBSTR@_com_util@@YGPA_WPBD@Z) WordAccount.obj

解决办法:

#pragma comment(lib, "comsuppw.lib")
#pragma comment(lib, "kernel32.lib")

加上这两句就可以,但不知道为什么。



https://blog.sciencenet.cn/blog-3199-6316.html

上一篇:Unhandled exception
下一篇:设置Maxthon为默认浏览器
收藏 IP: .*| 热度|

0

发表评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-19 18:13

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部