0

我有一个 C# COM DLL 的 C++ .NET COM DLL 包装器,我很好奇,是否可以在 UNIX 上使用 Mono 构建包装器?当我尝试时,我得到了很多这样的错误:

$>/opt/mono/bin/mcs /target:library *.cpp -recurse:'*.cpp' -warn:0 -out:my.dll -r:System.Windows.Forms.dll -r:System.Data.dll -r:System.Xml.Linq.dll

/AssemblyInfo.cpp(2,18): error CS1024: Wrong preprocessor directive
/AssemblyInfo.cpp(4,6):  error CS1041: Identifier expected, `namespace' is a keyword
/AssemblyInfo.cpp(4,22): error CS1001: Unexpected symbol `;', expecting identifier
/AssemblyInfo.cpp(42,1): error CS8025: Parsing error

我还是 COM 和 Mono 的新手,所以如果这个想法存在根本缺陷,我深表歉意。

PS。如果有兴趣,我可以包含实际代码,但我对一般机制更感兴趣。

4

1 回答 1

2

COM 组件不是跨平台的,它只适用于 Windows 操作系统,等效的跨平台替代方案是Firefox 使用的XPCOM 。

于 2012-10-01T20:45:43.510 回答