From: f.r.mitchell
Subject: Problems with foriegn code in SUN Lisp
Date: 
Message-ID: <2tsl9m$sum@nof.abdn.ac.uk>
Hi folks, I'm posting this for a student at my uni, 
so if you're emailing a reply, could you address it to

·····@csd.abdn.ac.uk

Thanks

Fraser

------------------------------------------------------------------


Hello there, I have a problem with defining foreign functions (C code) in Lisp.
(Sun Common Lisp)
I am using both version v4.1 & 4.2.  I define the function add2.c, as detailed on p10-7
of the v4.1 guide.  The code is compiled :-   gcc -c add2.c to produce the  add2.o file.

I then load this into lisp, however I either get the message 
USER(4): (load "add2.o")
; Foreign loading /home/msc/nazar/KDD/CODE/add2.o.
Error: Received signal number 10 (Bus error)

Restart actions (select using :continue):
 0: retry the load of add2.o
 [1] USER(5): :res


 or, if on another machine, 
 USER(1): (load "add2.o")
 ; Foreign loading /home/msc/nazar/KDD/CODE/add2.o.
 Error: Could not determine entry points of
	"/home/msc/nazar/KDD/CODE/add2.o".

	Restart actions (select using :continue):
	 0: retry the load of add2.o
	 [1] USER(2): 


There are not many people here with experience of mixed language processing, but someone suggested
that I might have compiled the code on a different machine to the one I was running Lisp on.
I deleted the .o file, & recompiled, but still no effect.

I ghave tried :-

(ff:remove-entry-point)
(and ff:get-entry-point "add2.o") which returns NIL
also I have tried entering
(use-package :ff)  and  (require :foreign) before loading the file in, but to no effect

Can you tell me what is going wrong,

Thanks in advance

Kamal Nazar

-------------------------------------------------------------

--
*****************************************************************************
*'For God so loved the world, that he gave his own son, so that         |   *
* *whoso-ever* believes in him shall not perish but have everlasting  -(+)- *
*life. For Christ did not come into the world to condemn it, but to     |   *
*be its saviour. John 3v16-17					        |   *
*****************************************************************************
*Fraser Mitchell, University of Aberdeen, Scotland.  ········@csd.abdn.ac.uk*
*****************************************************************************