chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] foreign-lambda* problems on Mac OS X


From: felix winkelmann
Subject: Re: [Chicken-users] foreign-lambda* problems on Mac OS X
Date: Tue, 12 Jul 2005 16:04:37 +0200

On 7/7/05, Raffael Cavallaro <address@hidden> wrote:
> Can someone provide me with a minimal example scheme file that shows
> proper use of foreign-lambda* or foreign-callback-lambda* or foreign-
> safe-lambda* - in other words, a scheme file that embeds c  code in
> the scheme file. Whenever I try to do this I get a linker error
> stating that the symbol in question - the name of the foreign-lambda*
> - prepended by an underscore, e.g., _foo is undefined:
> 
> /usr/bin/ld: Undefined symbols:
> _tak

I'm not exactly sure what the problem is here: is tak the name
of a Scheme procedure that you want to call? 
Here a few examples (all untested):

;;; simple use of foreign-lambda*:

(define yo
  (foreign-lambda* void ((int x))
    "printf(\"yo: %d\\n\", x);") )

(yo 33)


;;; simple use with callback:

(define-external (back) void
  (print "I'm back!") )

(define call
  (foreign-safe-lambda* void ()
    "back();") )

(call)


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]