newlisp.so import

Started by newdep, May 28, 2005, 01:37:44 AM

Previous topic - Next topic

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 libraryn");

exit(-1);

}

}
-- (define? (Cornflakes))

pjot

#1
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

newdep

#2
There are more libs I cant import with the C function above...

...oddity...
-- (define? (Cornflakes))