newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: newdep on May 28, 2005, 01:37:44 AM

Title: newlisp.so import
Post by: newdep on May 28, 2005, 01:37:44 AM
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);

}

}
Title:
Post by: pjot on May 28, 2005, 02:46:37 AM
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
Title:
Post by: newdep on May 28, 2005, 02:50:04 AM
There are more libs I cant import with the C function above...

...oddity...