Managed C++ Class Library

View: New views
2 Messages — Rating Filter:   Alert me  

Managed C++ Class Library

by eSPiYa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've been using C# and Mono for almost a year for the cross-platform implementation of my projects. Now, I'm starting to migrate some of the existing C++ projects to .NET 2.0 instead of creating a wrapper for it due to performance issues. Here are the sample codes: Tests.h --Header File using namespace System; namespace TestFuncs { public ref class MyClass { public: int DoSomething(); }; } Tests.cpp --Source File #include "Tests.h" namespace TestFuncs { int MyClass::DoSomething() { return 100; } } TestCSharp --console application in C# namespace TestCSharp { class Program { static void Main(string[] args) { TestFuncs.MyClass MyTest = new TestFuncs.MyClass(); Console.WriteLine(MyTest.DoSomething().ToString()); } } } I've successfully compiled the project using MSVS 2005's C++ compiler then add it as a reference for my C# console application for testing. It is working fine in .NET but when I tried it in mono I receive an error: implement type compare for 1b error. During the investigation I found out that the error occurs at the constructor part TestFuncs.MyClass MyTest = new TestFuncs.MyClass();. How to solve this? Thanks.

Re: Managed C++ Class Library

by Robert Jordan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

eSPiYa wrote:
> I've been using C# and Mono for almost a year for the cross-platform
> implementation of my projects.
>
> Now, I'm starting to migrate some of the existing C++ projects to .NET 2.0
> instead of creating a wrapper for it due to performance issues.

http://www.mono-project.com/CPlusPlus

See Kornél's "Code Generation" section.

Robert

_______________________________________________
Mono-list maillist  -  Mono-list@...
http://lists.ximian.com/mailman/listinfo/mono-list