Page 1 of 1

newlisp.so import

Posted: Sat May 28, 2005 8:37 am
by newdep
I thought it was me but the newlisp.so cant be imported.. I tried it with
using Rebol and that did not work then i tried with C and that also did
not work.. any idea?


1@zeep:~/prog/nl/progs$ gcc -ldl ./libdemo.c -o libdemo
1@zeep:~/prog/nl/progs$ libdemo
cannot import library

1@zeep:~/prog/nl/progs$ ls /usr/lib/newlisp.so
/usr/lib/newlisp.so*
1@zeep:~/prog/nl/progs$ ls -al /usr/lib/newlisp.so
-rwxr-xr-x 1 root root 228760 2005-05-28 10:26 /usr/lib/newlisp.so*

here the code..

#include <stdio.h>
#include <dlfcn.h>

int main()
{
void * hLibrary;

if((hLibrary = dlopen("/usr/lib/newlisp.so", RTLD_GLOBAL | RTLD_LAZY)) == 0)
{
printf("cannot import library\n");
exit(-1);
}
}

Posted: Sat May 28, 2005 9:46 am
by pjot
How did you compile "newlisp.so"?

Because if I leave the previous objectfiles in the sourcetree, and run 'make linux_lib', then indeed, the resulting 'newlisp.so' cannot be imported.

So, first perform a 'make clean' in your sourcetree, and after that, a 'make linux_lib' from scratch. This works for me. The resulting Shared Object imports with no problems.

Peter

Posted: Sat May 28, 2005 9:50 am
by newdep
There are more libs I cant import with the C function above...
...oddity...