2007/11/23, Robert Jordan <[EMAIL PROTECTED]>:
>
> 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
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to