如何将C .lib加载到托管c ++/CLI项目中?

如何将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.