[Mono-devel-list] How to use shared library with C# on linux

Marcus mathpup at mylinuxisp.com
Wed Nov 19 14:41:04 EST 2003


Notice in the warning messages:

** (LibTest.exe:23664): WARNING **: Failed to load library ./libtestlib.so 
(testlib): ./libtestlib.so: cannot open shared object file: No such file or 
directory

Mono is looking for a shared lib called "libtestlib.so", whereas you have 
compiled yours to "testlib.so". For some reason, Mono wants to append "lib" 
to the front of your .so. This is really a bad idea. Rotor does it correctly 
and your program works as-is on Rotor.

I'd recommend just using Rotor, as I've been told by Miguel that Mono really 
isn't ready for production work.


On Wednesday 19 November 2003 11:23 am, Daniel Schalk wrote:
> Hi,
>
> I'm trying to code a C# app, which calls a C-function out of a shared
> library (e.g. testlib.so).
> In the testlib.cc i placed the following code:
>
> #include <stdio.h>
>
> void fktTest(void)
> {
> 	printf("called fktTest");
> }
>
> I compiled it with: gcc -c -fpic testlib.cc
> then: gcc -shared -fpic -o testlib.so testlib.o



More information about the Mono-devel-list mailing list