--test-foos.scm----- (require-extension bind coops cplusplus-object) (bind "#include \"foo.h\"") (define x (make-instance 99)) (print (getX x)) ; prints ''99'' (setX x 42) (print (getX x)) ; prints ''42'' (destroy x) -------------- --foo.h---- #ifndef _FOO_H_ #define _FOO_H_ class Foo { private: Foo(); int x_; public: Foo(int x); void setX(int x); int getX(); }; #endif -------------- --foo.cpp---- #include "foo.h" Foo::Foo(int x) : x_(x) { } void Foo::setX(int x) { x_ = x; } int Foo::getX() { return x_; } -------------- $ g++ -c foo.cpp $ csc test-foo.scm foo.o -c++ test-foo.cpp: In function ‘long int stub227(long int, long int)’: test-foo.cpp:37:1: error: ‘Foo’ was not declared in this scope test-foo.cpp:37:6: error: ‘g62’ was not declared in this scope test-foo.cpp:37:16: error: expected primary-expression before ‘)’ token test-foo.cpp:37:17: error: expected ‘;’ before ‘C_c_pointer_or_null’ test-foo.cpp: In function ‘long int stub161(long int, long int, long int)’: test-foo.cpp:48:1: error: ‘Foo’ was not declared in this scope test-foo.cpp:48:6: error: ‘g58’ was not declared in this scope test-foo.cpp:48:16: error: expected primary-expression before ‘)’ token test-foo.cpp:48:17: error: expected ‘;’ before ‘C_c_pointer_or_null’ test-foo.cpp: In function ‘long int stub130(long int, long int)’: test-foo.cpp:61:41: error: expected type-specifier before ‘Foo’ test-foo.cpp:61:41: error: expected ‘)’ before ‘Foo’ test-foo.cpp: In function ‘long int stub103(long int, long int)’: test-foo.cpp:68:1: error: ‘Foo’ was not declared in this scope test-foo.cpp:68:6: error: ‘t0’ was not declared in this scope test-foo.cpp:68:15: error: expected primary-expression before ‘)’ token test-foo.cpp:68:16: error: expected ‘;’ before ‘C_c_pointer_or_null’ test-foo.cpp:69:11: error: type ‘’ argument given to ‘delete’, expected pointer Error: shell command terminated with non-zero exit status 256: g++ test-foo.cpp -o test-foo.o -c -Wno-write-strings -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I"/usr/include/chicken"