From: Ron Fox Date: 2008-03-21T18:29:53+09:00 Subject: Re: extending ruby with C++ Try using g++ to link the code rather than cc. Using cc does not include the g++ run-time libraries in the link. Ron. 7stud -- wrote: > I'm using this old (2001) mini tutorial: > > http://www.angelfire.com/electronic2/issac/rb_cpp_ext_tut.txt > > When I run make, I get this error: > > $ make > cc -bundle -L"/usr/lib" -o Test.bundle Test.o -lruby -lpthread -ldl > -lobjc > /usr/bin/ld: Undefined symbols: > __Unwind_Resume > std::basic_ostream >::operator<<(int) > std::basic_ostream >::operator<<(unsigned > long) > std::ios_base::Init::Init() > std::ios_base::Init::~Init() > std::__throw_bad_alloc() > std::__throw_length_error(char const*) > std::cout > std::basic_ostream >& std::endl std::char_traits >(std::basic_ostream >> &) > std::basic_ostream >& std::operator<< > >(std::basic_ostream std::char_traits >&, char const*) > operator delete(void*) > operator new(unsigned long) > ___gxx_personality_v0 > collect2: ld returned 1 exit status > make: *** [Test.bundle] Error 1 > > $ ls > Makefile Test.cpp Test.o extconf.rb > > I tried that on mac osx. Any idea what's wrong?