[Mono-dev] DllImport on mono at linux

Zoltan Varga vargaz at gmail.com
Mon Jun 12 16:58:15 EDT 2006


  An assert in free () usually indicates memory usage problems in the managed
signature of your function. You should read:


and possibly the MSDN docs about pinvoke as well, especially the memory
management rules (i.e. who frees what).


On 6/12/06, shw <jaroslaw.pendowski at gmail.com> wrote:
> Hi!
> 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.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list