[Mono-list] C/C++ issue
Jonas Thor
jonas.thor at consoden.se
Fri Nov 23 13:30:38 EST 2007
2007/11/23, Robert Jordan <robertj at gmx.net>:
>
> First, you have to link with -fPIC switch:
>
> gcc -fPIC --shared -o libhello_cpp.so hello_cpp.cpp
>
> gcc -fPIC --shared -o libhello_c.so hello_c.c
>
> Second, what's the output of "ldd libhello_cpp.so"?
Here is some more output:
<-- snip -->
ruskprick ~/src/monotest $ make
gmcs HelloSample.cs
gcc -fPIC --shared -o libhello_c.so hello_c.c
gcc -fPIC --shared -o libhello_cpp.so hello_cpp.cpp
ruskprick ~/src/monotest $ mono HelloSample.exe
C Hello world...
Unhandled Exception: System.DllNotFoundException: libhello_cpp
at (wrapper managed-to-native) HelloSample:print_hello_world_cpp ()
at HelloSample.Main () [0x00000]
ruskprick ~/src/monotest $ ldd libhello_cpp.so
linux-gate.so.1 => (0x00110000)
libc.so.6 => /lib/libc.so.6 (0x00113000)
/lib/ld-linux.so.2 (0x00ba2000)
ruskprick ~/src/monotest $ ldd libhello_c.so
linux-gate.so.1 => (0x00110000)
libc.so.6 => /lib/libc.so.6 (0x00113000)
/lib/ld-linux.so.2 (0x00ba2000)
ruskprick ~/src/monotest $
<-- snip -->
/jonas
--
Jonas Thor
direct/mobile: +46(0)18-610 22 62
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20071123/521a736f/attachment-0001.html
More information about the Mono-list
mailing list