On 1/18/07, Elliot Cuzzillo <[EMAIL PROTECTED]> wrote:
This leads me to think that some kind of name mangling in C++ prevents
callbacks from having the correct name, or something. Is calling
Scheme from C++ (as opposed to C) feasible, or should I h
Is the C interface supposed to work with C++?
When I try to compile the same example (which john provided) with the
-c++ option, the compiler borks on the line
C_word k = CHICKEN_run(C_toplevel);
with the error
[EMAIL PROTECTED] scheme]$ csc x2.scm y2.c -embedded -c++
y2.c: In function `int mai
On 1/16/07, Elliot Cuzzillo <[EMAIL PROTECTED]> wrote:
I would very much like to know what I'm doing wrong, so that I can
finally call a Scheme function from C. I also think it would be good
to add an example of this to the wiki, because, unless I am being very
stupid, it is not completely obvio
Thanks! That works.
Elliot
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users
You don't need easyffi in your example. A call to print out the value
of string-length could be added.
A more simplified example:
x2.scm
(define-external (foo (c-string x)) int (print (string-length x)))
(return-to-host)
y2.c
#include "chicken.h"
extern int foo(char* blah);
int main()
I've been trying for a while now to get a main C program to get
compiled with a Scheme program and call a Scheme callback. My current
attempt follows; I just modified one of the embedding examples, so I
wouldn't get the embedding part wrong.
x2.scm:
-
(require-extension srfi-18 easyff