[Mono-list] Managed C++ Class Library

eSPiYa vdolosa at gmail.com
Tue Jun 30 05:17:10 EDT 2009


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.
-- 
View this message in context: http://www.nabble.com/Managed-C%2B%2B-Class-Library-tp24268697p24268697.html
Sent from the Mono - General mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090630/fadb50e0/attachment.html 


More information about the Mono-list mailing list