如何将C .lib加载到托管c ++/CLI项目中? [英] How to load C .lib into managed c++/CLI project?

查看:238
本文介绍了如何将C .lib加载到托管c ++/CLI项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我需要将C库加载到CLR项目(托管的c ++/CLI)中.
已添加所有头文件和lib文件.但是在编译项目时,会出现一些错误和警告,如下所示:

错误:
错误LNK2001:无法解析的外部符号"extern" C"int __stdcall rsslDecodeMsg(struct RsslDecIterator *,union RsslMsg *)"(?rsslDecodeMsg @@ $$ J18YGHPAURsslDecIterator @@ PATRsslMsg @@@ Z)

警告:
警告C4561:``__fastcall''与``/clr''选项不兼容:转换为``__stdcall''


有人可以帮我解决这个问题吗?
预先谢谢您.

Currently I need to load a C lib into my CLR project(managed c++/CLI).
All the header file and lib file have been added. But when compile the project, there are some errors and warning like below:

Errors:
error LNK2001: unresolved external symbol "extern "C" int __stdcall rsslDecodeMsg(struct RsslDecIterator *,union RsslMsg *)" (?rsslDecodeMsg@@$$J18YGHPAURsslDecIterator@@PATRsslMsg@@@Z)

Warning:
warning C4561: ''__fastcall'' incompatible with the ''/clr'' option: converting to ''__stdcall''


Can someone kindly help me to solve this issue?
Thank you in advance.

推荐答案

J18YGHPAURsslDecIterator @@ PATRsslMsg @@@@ Z)

警告:
警告C4561:``__fastcall''与``/clr''选项不兼容:转换为``__stdcall''


有人可以帮我解决这个问题吗?
预先谢谢您.
J18YGHPAURsslDecIterator@@PATRsslMsg@@@Z)

Warning:
warning C4561: ''__fastcall'' incompatible with the ''/clr'' option: converting to ''__stdcall''


Can someone kindly help me to solve this issue?
Thank you in advance.


这篇关于如何将C .lib加载到托管c ++/CLI项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆