[Mono-list] Failing dlopen on Linux via DllImport with error message 'dlopen: invalid caller'

2013-11-25 Thread Jean-Michel.Perraud
Hi, If anyone has an insight, experience or even hint on this one, this would be greatly appreciated. I have a C# application that loads the a native shared library (the R shared library). I use DllImport as follows: [DllImport(libdl)] private static extern IntPtr

Re: [Mono-list] Failing dlopen on Linux via DllImport with error message 'dlopen: invalid caller'

2013-11-25 Thread Jonathan Pryor
On Nov 25, 2013, at 5:47 PM, jean-michel.perr...@csiro.au wrote: [DllImport(libdl)] [return: MarshalAs(UnmanagedType.LPStr)] private static extern string dlerror(); You should (almost?) never use `string` (or any other reference type) as the return type in a P/Invoke method: