From: Peter Wood Date: 2005-04-07T00:01:05+09:00 Subject: Re: extconf.rb and dyld problem >On 6 Apr 2005, at 15:33, Peter Wood wrote: > >>>if have_header("fmod.h") >>> if RUBY_PLATFORM =~ /darwin/ >>> CONFIG["CC"] = "c++" >>> CONFIG["LDSHARED"].gsub!("cc","g++") #make sure you're >>>using g++ so it links libstdc++ >>> CONFIG['LDSHARED'].gsub!('gcc','g++') >>> $create = true if have_library("fmod") >>> elsif have_library("fmod") #more than likely a linux box >>> CONFIG['LDSHARED'].gsub!('gcc','g++') #make sure c++ gets >>>linked properly >>> $create = true >>> end >>>end >>From your mail it looks as if you doing your best to use the C++ >>compiler rather than the standard C compiler. Won't you then be >>subject to name mangling? Ruby is expecting certain elements under >>standard names. If those names have been mangled by the C++ >>compiler it won't find them. > >The libraries I'm trying to compile/link are C++, so I thought I >-had- to use the C++ compiler? > >d Apologies, I should have been more specific. Where you mix C and C++ code you must explicitly pick out the elements that to be treated in the C way from those that will be handled in the C++ way. Another mail on this topic has already referred to marking the initialization function with extern "C". You may have to do this for other elements as well, although an exact list of what requires it will depend on the symbols that are missing.