[Mono-dev] DllImport on mono at linux

shw jaroslaw.pendowski at gmail.com
Mon Jun 12 16:52:19 EDT 2006

I've made some app with mono. To generate and check serial numbers it
uses binary library.
On windows everything is working - on linux - not.

I've tried to compile some different ways and came to compile library with:
g++ -shared -fPIC -o libpossible-keys.so *.cpp

with this kind of compilation mono finds library, finds function but
still throws an error:

Mono-INFO: DllImport attempting to load: 'possible-keys'.
Mono-INFO: DllImport loading location: 'libpossible-keys.so'.
Mono-INFO: DllImport error loading library: 'libpossible-keys.so: nie
moĹźna otworzyÄ pliku obiektu dzielonego: Nie ma takiego pliku ani
katalogu'. (in english it is sth like "couldn't open shared object
file: no file or directory")
Mono-INFO: DllImport loading library: './libpossible-keys.so'.
Mono-INFO: Searching for 'CreateActivation'.
Mono-INFO: Probing 'CreateActivation'.
Mono-INFO: Found as 'CreateActivation'.
Wrapper tester
*** glibc detected *** free(): invalid next size (fast): 0x0824cae0 ***

What is wrong?
The same code on Windows works, when i compile source without -shared
and run with sth like
./libpossible-keys.so arguments_to_generate_activation_key
it works, but as method with DllImport - not.

More information about the Mono-devel-list mailing list