newlisp.so import

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

newlisp.so import

Post 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);
}
}
-- (define? (Cornflakes))

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post 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

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

There are more libs I cant import with the C function above...
...oddity...
-- (define? (Cornflakes))

Locked