Based on your update, you shouldn't be using the __MonoCS__
preprocessor. It means you would have to recompile the library for Mono and .NET. The better way is to use dllmap
functionality in Mono and only use the msvcrt.dll
DllImport.
Instead define a "AssemblyName.dll.config" and use the dllmap
tag to map msvcrt.dll
to c
when run on Mono.
Example:
<configuration>
<dllmap dll="msvcrt.dll" target="libc.so.6" />
</configuration>
More detail on dllmap here: http://www.mono-project.com/Config_DllMap
EDIT
And if for some reason c
doesn't work, libc.so
should work.