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

Jonathan Pryor jonpryor@vt.edu
Sat, 12 Feb 2005 17:52:12 -0500


On Sat, 2005-02-12 at 22:04 +0000, James Fitzsimons wrote:
> > 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. :-)
> Actually I have written a bunch of C programs which compile, link and run against 
> that library just fine so unfortunately that doesn't help us much.

The question becomes whether or not your programs are 32-bit or 64-bit
programs, and ditto for your library.

Running "file" and "ldd" on your programs and your libraries would help.
It would also be good to run them on "mono", to see if it's actually
using a 32-bit or 64-bit environment.

It might also be good to see if this helps:

	http://gcc.fyxm.net/summit/2003/Porting%20to%2064%20bit.pdf

It mentions the use of `file`, `ldd`, and how to get GCC to generate
programs for the correct ABI (though 64-bit programs appear to be the
default).

Finally, you should try running mono with MONO_LOG_LEVEL=info and
MONO_lOG_MASK=dll.  That will print out what libraries Mono is trying to
load, and may suggest why Mono can't find your library.

 - Jon