From: Edson Scalabrin
Subject: Shared Objects in CtoLisp
Date: 
Message-ID: <3th0o7$o6t@sunsic.si.univ-compiegne.fr>
Hi There,

I need to build an interface between C and 
Lucid Common Lisp/SPARC Solaris, Development 
Environnement version 4.1.1. But I any problem to use 
shring objects (i.e. files .so).

I illustrate my problem in the next example:  

First example: 
	- To get the program object of the c program I compile as:
  cc -c mgf.c 

  	- In Lisp I do:

     (load-foreign-files "mgf.o" '("-lc" "-lm" 
                         "-lmatisseDS" "-lsocket" "-lnsl" "-lintl"))

     (def-foreign-function (MOpen (:language :c)
		             (:name "MgfOpen")
 		             (:return-type :unsigned-32bit))
        (node       :simple-string)
        (database   :simple-string))

  (foreign-undefined-symbol-names)
  NIL

  (setq x (Mopen "asterix" "database"))

	- At execution time I get the message:

  >>Error: Foreign code calling unsupported function dlopen("switch.so",1)
  "Unknown Foreign Function"


Second example:
	In this case I get the file.o then link all the .o files in the file
temp.o. Finaly as before I load this only .o file, but I still have the error
message.

  cc -c mgf.c
  ld -r mgf.o -lmatisseDS -lnsl -lintl -o temp.o
  in Lisp
     (load-foreign-files "temp.o")

   ...

  >>Error: Foreign code calling unsupported function dlopen("switch.so",1)
  "Unknown Foreign Function"

Then my problem is how to use files .so in a Lisp file. The function dlopen
is supported in the system, because I have some exemples with other languages
like C. 

Please help!
thanks a lot!