From: Lea Savage Date: 2010-04-20T23:45:14+09:00 Subject: Re: Extending Ruby using C++ and Rice Thanks for the suggestions. I now have this working by doing the following: - Removed the extern "C" as Jason suggested - Moved my code into a dynamic library (using XCode) and included references to the xtoolkit library and include files. - Ensured that the static library was being included during compilation in my extconf.rb then checking that it is loaded correctly: require 'rubygems' require 'mkmf-rice' $LIBS << ' -lXternalDebug' have_library("stdc++") have_library("XternalDebug") dir_config("xtoolkit") dir_config("mytest") have_library("MyTest") have_header("MyTest.h") create_makefile("my_test") Added the XternalDebug to my LD_LIBRARY_PATH and my MyTest dynamic library to DYLD_LIBRARY_PATH I run the extconf.rb with the following arguments: ARCHFLAGS="-arch i386" ruby extconf.rb --with-mytest-include=/Users//mytest/MyTest --with-mytest-lib=/Users//mytest/MyTest --with-xtoolkit-include=/Users//xtoolkit/public/include Kind regards, Lea -- Posted via http://www.ruby-forum.com/.