From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-05-09T21:59:05+09:00 Subject: extern "C" of prep_stdio Im trying to handover a pipe from C++ to ruby. Im doing this in order to make the functions available to C++. extern "C" { #include // rb_fdopen static VALUE prep_stdio(FILE *, int, VALUE); } // extern "C" So far so good.. this compiles without problems. I want to do the same as in "io.c" w = prep_stdio(rb_fdopen(pipes[1], "w"), FMODE_WRITABLE|FMODE_SYNC, rb_cIO); But if I try compiling this, then G++ complains about the externed prep_stdio.. > gmake g++ main.cpp -lc_r -I/home/neoneye/install/language/ruby-1.8.0 /home/neoneye/install/language/ruby-1.8.0/libruby-static.a -lcrypt -Wall #-fpermissive main.cpp: In function `int main(int, char**)': main.cpp:116: warning: unused variable `FILE*fd' /usr/include/g++/streambuf: At top level: main.cpp:15: `VALUE prep_stdio(FILE*, int, long unsigned int)' used but never defined gmake: *** [all] Fejl 1 > Is there anyone around which knows how to extern "C" rubys internals ? -- Simon Strandgaard