mail-archives/mono-list/2005-February/025684.html

200 строки
8.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-list] P/Invoke on amd64 was :Marshalling problems
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:james.fitzsimons%40gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="025675.html">
<LINK REL="Next" HREF="025686.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-list] P/Invoke on amd64 was :Marshalling problems
</H1>
<B>James Fitzsimons
</B>
<A HREF="mailto:james.fitzsimons%40gmail.com"
TITLE="[Mono-list] P/Invoke on amd64 was :Marshalling problems">james.fitzsimons@gmail.com
</A><BR>
<I>Sun, 13 Feb 2005 10:44:20 +0000</I>
<P><UL>
<LI> Previous message: <A HREF="025675.html">[Mono-list] P/Invoke on amd64 was :Marshalling problems
</A></li>
<LI> Next message: <A HREF="025686.html">[Mono-list] P/Invoke on amd64 was :Marshalling problems
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#25684">[ date ]</a>
<a href="thread.html#25684">[ thread ]</a>
<a href="subject.html#25684">[ subject ]</a>
<a href="author.html#25684">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>--=-z0W7DHZJCk7V7N1GGWit
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Hi Jonathan, Michal,
On Sat, 2005-02-12 at 22:52, Jonathan Pryor wrote:
The question becomes whether or not your programs are 32-bit or 64-bit
&gt;<i> programs, and ditto for your library.
</I>&gt;<i>=20
</I>&gt;<i> Running &quot;file&quot; and &quot;ldd&quot; on your programs and your libraries would help.
</I>Ok, firstly running file and ldd on the Curses program example in my
last email:
<A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ file -k /lib64/libncurses.so.5.4=20
/lib64/libncurses.so.5.4: ELF 64-bit LSB shared object, AMD x86-64,
version 1 (SYSV), stripped
<A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ file -k Curses.exe
Curses.exe: MS Windows PE 32-bit Intel 80386 console executable\012-
MS-DOS executable (EXE), OS/2 or MS Windows
<A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ file /usr/local/bin/mono
/usr/local/bin/mono: ELF 64-bit LSB executable, AMD x86-64, version 1
(SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not
stripped
Now for the actual libraries I am trying to use in my real program:
<A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ file -k /usr/local/lib/libhighgui-0.9.so.5.0.0=20
/usr/local/lib/libhighgui-0.9.so.5.0.0: ELF 64-bit LSB shared object,
AMD x86-64, version 1 (SYSV), not stripped
<A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ file -k /usr/local/lib/libopencv-0.9.so.5.0.0 =20
/usr/local/lib/libopencv-0.9.so.5.0.0: ELF 64-bit LSB shared object, AMD
x86-64, version 1 (SYSV), not stripped
(this is a C program which uses the above libraries just fine)
<A HREF="mailto:james@athos">james@athos</A> objRec $ file -k objectRecognition
objectRecognition: ELF 64-bit LSB executable, AMD x86-64, version 1
(SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), not
stripped
Finally, you should try running mono with MONO_LOG_LEVEL=3Dinfo and
&gt;<i> MONO_lOG_MASK=3Ddll.
</I>When I try to run the curses example with logging on I get the following:
Mono-INFO: DllImport loading: 'libncurses'.
Mono-INFO: DllImport error loading library '/usr/lib/libncurses.so:
invalid ELF header'.
(Curses.exe:10129): Mono-WARNING **: DllImport unable to load library
'/usr/lib/libncurses.so: invalid ELF header'.
And with my open computer vision program:
Mono-INFO: DllImport loading: 'libopencv'.
Mono-INFO: DllImport error loading library '/usr/local/lib/libopencv.so:
undefined symbol: __gxx_personality_v0'.
(CvImage.exe:16545): Mono-WARNING **: DllImport unable to load library
'/usr/local/lib/libopencv.so: undefined symbol: __gxx_personality_v0'.
So, it looks like mono finds the libncurses library, but can't load it
for some reason, like wise with the opencv library. The error message is
a bit miss leading in this case. I still don't know how to fix the
problem though.
On Sun, 2005-02-13 at 01:03, Michal Moskal wrote:
&gt;<i> The example works for me without any problems, some other info:
</I>Ok this is strange...I wonder what is different between your environment
and mine that it doesn't work on mine?
&gt;<i> [<A HREF="mailto:malekith@r64">malekith@r64</A> 07-pinvoke]$ ldd =3Dmono
</I>&gt;<i> libgthread-2.0.so.0 =3D&gt; /usr/lib64/libgthread-2.0.so.0
</I>&gt;<i> (0x0000002a9566c000)
</I>&gt;<i> libgmodule-2.0.so.0 =3D&gt; /usr/lib64/libgmodule-2.0.so.0
</I>&gt;<i> (0x0000002a95770000)
</I>&gt;<i> libdl.so.2 =3D&gt; /lib64/libdl.so.2 (0x0000002a95874000)
</I>&gt;<i> libglib-2.0.so.0 =3D&gt; /usr/lib64/libglib-2.0.so.0 (0x0000002a9597=
</I>7000)
&gt;<i> libnsl.so.1 =3D&gt; /lib64/libnsl.so.1 (0x0000002a95afc000)
</I>&gt;<i> libpthread.so.0 =3D&gt; /lib64/tls/libpthread.so.0 (0x0000002a95c130=
</I>00)
&gt;<i> libm.so.6 =3D&gt; /lib64/tls/libm.so.6 (0x0000002a95d28000)
</I>&gt;<i> librt.so.1 =3D&gt; /lib64/tls/librt.so.1 (0x0000002a95eac000)
</I>&gt;<i> libc.so.6 =3D&gt; /lib64/tls/libc.so.6 (0x0000002a95fb6000)
</I>&gt;<i> /lib64/ld-linux-x86-64.so.2 (0x0000002a95556000)
</I><A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ ldd /usr/local/bin/mono
libgthread-2.0.so.0 =3D&gt; /usr/lib/libgthread-2.0.so.0
(0x0000002a9566c000)
libgmodule-2.0.so.0 =3D&gt; /usr/lib/libgmodule-2.0.so.0
(0x0000002a95770000)
libdl.so.2 =3D&gt; /lib/libdl.so.2 (0x0000002a9589b000)
libglib-2.0.so.0 =3D&gt; /usr/lib/libglib-2.0.so.0
(0x0000002a9599e000)
libnsl.so.1 =3D&gt; /lib/libnsl.so.1 (0x0000002a95b22000)
libpthread.so.0 =3D&gt; /lib/libpthread.so.0 (0x0000002a95c39000)
libm.so.6 =3D&gt; /lib/libm.so.6 (0x0000002a95dce000)
librt.so.1 =3D&gt; /lib/librt.so.1 (0x0000002a95f54000)
libc.so.6 =3D&gt; /lib/libc.so.6 (0x0000002a9606e000)
/lib64/ld-linux-x86-64.so.2 (0x0000002a95556000)
<A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $
(remember on my system /lib, and /usr/lib) are symlinked to /lib64)
&gt;<i> [<A HREF="mailto:malekith@r64">malekith@r64</A> 07-pinvoke]$ mono --version
</I>&gt;<i> Mono JIT compiler version 1.1.4, (C) 2002-2004 Novell, Inc and
</I>&gt;<i> Contributors. www.go-mono.com
</I>&gt;<i> TLS: __thread
</I>&gt;<i> GC: Included Boehm (with typed GC)
</I>&gt;<i> SIGSEGV : normal
</I>&gt;<i> Globalization: none
</I><A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ mono --version
Mono JIT compiler version 1.1.4.20050210, (C) 2002-2004 Novell, Inc and
Contributors. www.go-mono.com
TLS: __thread
GC: Included Boehm (with typed GC)
SIGSEGV : normal
Globalization: none
&gt;<i> [<A HREF="mailto:malekith@r64">malekith@r64</A> 07-pinvoke]$ uname -a
</I>&gt;<i> Linux roke 2.6.10-0.96 #1 Sun Jan 9 06:11:03 CET 2005 x86_64 0 unknown PL=
</I>D Linux
<A HREF="mailto:james@athos">james@athos</A> 07-pinvoke $ uname -a
Linux athos 2.6.9-gentoo-r14 #8 Sun Jan 30 08:53:55 UTC 2005 x86_64 AMD
Athlon(tm) 64 Processor 3400+ AuthenticAMD GNU/Linux
Thanks very much for your patience guys and thanks for any help you can
provide!
Cheers,
James
--=20
It's 5.50 a.m.... Do you know where your stack pointer is ?
--=-z0W7DHZJCk7V7N1GGWit
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQBCDy9qtf4qL6AoafMRAqPhAKDm5+dkVR6xD81PUAZNMNm7Rx8IoACgh969
u7VT6b+s7ksimWivhV6I+NI=
=leba
-----END PGP SIGNATURE-----
--=-z0W7DHZJCk7V7N1GGWit--
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="025675.html">[Mono-list] P/Invoke on amd64 was :Marshalling problems
</A></li>
<LI> Next message: <A HREF="025686.html">[Mono-list] P/Invoke on amd64 was :Marshalling problems
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#25684">[ date ]</a>
<a href="thread.html#25684">[ thread ]</a>
<a href="subject.html#25684">[ subject ]</a>
<a href="author.html#25684">[ author ]</a>
</LI>
</UL>
</body></html>