views:

95

answers:

3

I have a dll. and visual C++ source for it. (my dll is visual c++ wraper around some ffmpeg av* libs - another precompiled dll's) while in the same solution (.sln) I have C# project that uses my dll.

what are general steps for me to port my project to mono?

+2  A: 

Compile your project in Visual Studio, but enable the following compiler options:

  • /clr:pure: This will make a pure CLR assembly (without any x86/x86-64 asm), that should run on mono, unless you use some C runtime calls (CRT).
  • /clr:safe: The same as pure, but you can't have CRT references, so your project might not compile. If it doesn't, replace those function calls with other portable calls.

The resulting assembly should be pure CLR and will work with Mono.

This page contains everything you might encounter when compiling a version that works on Mono.

Matias Valdenegro
The point of his wrapper assembly is likely to mix managed and unmanaged code in a single assembly (mixed-mode assembly). Restricting the assembly to CLR defeats this.
dtb
A: 

I would suggest also take a look at this -

http://mono-tools.com/store/

There are various tools available to help you port to Mono - you can even debug within visual studio and package it for deployment on Linux.

Roopesh Shenoy
I am getting some negative posts so let me assure you - I AM NOT SELLING THIS PRODUCT - I just think its a good idea to look at tools and save time.
Roopesh Shenoy
I think the downvotes are because Mono simply doesn't run mixed-mode assemblies on Linux. MonoTools don't help here.
dtb
+3  A: 

Mono does not support mixed-mode assemblies on non-Windows operating systems.

Remove your C++ wrapper and rewrite your application to only use P/Invoke to call into native code.

See also: www.mono-project.com/CPlusPlus

dtb