[Mono-list] P/Invoke on amd64 was :Marshalling problems

Jonathan Pryor jonpryor@vt.edu
Sat, 12 Feb 2005 11:47:42 -0500

On Sat, 2005-02-12 at 15:18 +0000, James Fitzsimons wrote:
> Hi Jonathan,
> On Sat, 2005-02-12 at 15:07, Jonathan Pryor wrote:
> > > > Unhandled Exception: System.DllNotFoundException: highgui
> > > > in <0x000bf> (wrapper managed-to-native) Slam.CvImage:cvLoadImage
> > > > (string,int)
> > > > in <0x00068> Slam.CvImage:.ctor (string,bool)
> > > > in <0x00069> Slam.MainClass:Main (string[])
> > 
> > Silly question, but where is libhighgui.so installed?  IIRC, 64-bit apps
> > need to have their libraries in /lib64 or /usr/lib64.  Is this where
> > libhighgui.so is located?
> libhighgui.so is located in /usr/local/lib. This should be fine however
> as according to this http://www.jprl.com/interop.html#library-linux if
> your target library is in /etc/ld.so.cache P/Invoke should find it.

I know what it says; I wrote it.  I also know that I have virtually zero
knowledge or experience with mixed 64-bit/32-bit platforms, which
Linux/Amd64 is.  Consequently, my guide is somewhat lacking, if only
because I don't know everything. :-)

I have heard that there are /lib64 directories that are searched for 64-
bit libraries, but that's about it.  Not having an AMD64 platform of my
own, it's hard to test for anything else.

So as an experiment, try writing a C program which uses that library,
and compile/link with the 64-bit GCC (whatever that may be named), and
run your C program.  If this fails, which I suspect it will, you will
know why Mono can't find your library. :-)

Then, you can tell us what it takes to find the library, I can update my
guide, and everyone can be happy. :-)

 - Jon