LibNeural on OS X: undefined symbols

Running OS X 10.2.4, trying to make use of Akimichi Tatsukawa’s
LibNeural package. I downloaded Swig 1.3.9 and built it from source
(it’s the version listed on the LibNeural page as having been used to
test it), with no errors I could see. The LibNeural package also
built with no errors, but when I ran the test scripts I got a whole
mess of undefined symbol errors like so:

ruby odd_even.rb
dyld: ruby Undefined symbols:
__ZNSi7getlineEPcic
__ZNSiC4EPSt15basic_streambufIcSt11char_traitsIcEE
__ZNSiD4Ev
__ZNSirsERf
__ZNSirsERi
__ZNSoC4EPSt15basic_streambufIcSt11char_traitsIcEE
__ZNSoD4Ev
__ZNSolsEPFRSoS_E
__ZNSolsEd
__ZNSolsEl
__ZNSolsEm
__ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
__ZNSt13basic_filebufIcSt11char_traitsIcEE5closeEv
__ZNSt13basic_filebufIcSt11char_traitsIcEEC1Ev
__ZNSt13basic_filebufIcSt11char_traitsIcEED4Ev
__ZNSt8ios_base4InitC1Ev
__ZNSt8ios_base4InitD1Ev
__ZNSt8ios_baseC2Ev
__ZNSt8ios_baseD2Ev
__ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E
__ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
__ZNSt9basic_iosIcSt11char_traitsIcEED4Ev
__ZSt4cout
_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6
__ZSt9terminatev
__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3
__ZTTSt14basic_ifstreamIcSt11char_traitsIcEE
__ZTTSt14basic_ofstreaTrace/BPT trap

Has anyone run into anything similar on OS X or anywhere else for that
matter? I searched the newsgroup but the only thing I found relating
to LibNeural was a release announcement.

Thanks,
_dave

Hi, I’m Akimichi Tatsukawa, the author of LibNeural.
It seems to me that linking to the standard C++ library is not properly done.
In the file ‘ext/LibNeural/extconf.rb’, check out the following option
if it is proper or not under your environment.

$LDFLAGS = “-L/usr/lib -lstdc++”

I don’t know about Mac, so I might give your a wrong advice.

···

At Sat, 1 Mar 2003 06:05:50 +0900, Dave Dembinski wrote:

Running OS X 10.2.4, trying to make use of Akimichi Tatsukawa’s
LibNeural package. I downloaded Swig 1.3.9 and built it from source
(it’s the version listed on the LibNeural page as having been used to
test it), with no errors I could see. The LibNeural package also
built with no errors, but when I ran the test scripts I got a whole
mess of undefined symbol errors like so:

ruby odd_even.rb
dyld: ruby Undefined symbols:
__ZNSi7getlineEPcic
__ZNSiC4EPSt15basic_streambufIcSt11char_traitsIcEE
__ZNSiD4Ev
__ZNSirsERf
__ZNSirsERi
__ZNSoC4EPSt15basic_streambufIcSt11char_traitsIcEE
__ZNSoD4Ev
__ZNSolsEPFRSoS_E
__ZNSolsEd
__ZNSolsEl
__ZNSolsEm
__ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
__ZNSt13basic_filebufIcSt11char_traitsIcEE5closeEv
__ZNSt13basic_filebufIcSt11char_traitsIcEEC1Ev
__ZNSt13basic_filebufIcSt11char_traitsIcEED4Ev
__ZNSt8ios_base4InitC1Ev
__ZNSt8ios_base4InitD1Ev
__ZNSt8ios_baseC2Ev
__ZNSt8ios_baseD2Ev
__ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E
__ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
__ZNSt9basic_iosIcSt11char_traitsIcEED4Ev
__ZSt4cout
_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6
__ZSt9terminatev
__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3
__ZTTSt14basic_ifstreamIcSt11char_traitsIcEE
__ZTTSt14basic_ofstreaTrace/BPT trap

Has anyone run into anything similar on OS X or anywhere else for that
matter? I searched the newsgroup but the only thing I found relating
to LibNeural was a release announcement.

Thanks,
_dave

Akimichi Tatsukawa akimichi@mbox.co.jp wrote in message news:87k7fhg42q.wl@tatsu.localdomain

Hi, I’m Akimichi Tatsukawa, the author of LibNeural.
It seems to me that linking to the standard C++ library is not properly done.
In the file ‘ext/LibNeural/extconf.rb’, check out the following option
if it is proper or not under your environment.

$LDFLAGS = “-L/usr/lib -lstdc++”

I don’t know about Mac, so I might give your a wrong advice.

Thanks, Akimichi! I got it working, finally, but it took some doing.
Apple doesn’t include libruby.a in their standard distro, so I had to
build that and install it form 1.6.8, then make the following changes
to the extconf.rb file you pointed at:

$CFLAGS=“-no-cpp-precomp”
$LDFLAGS=“-L/usr/lib -ltinfo -lgcc -lstdc++”

I added this to the RubyOnMacintosh section of rubygarden.org, in case
anyone else could find it useful.

thanks again,
_dave

···

At Sat, 1 Mar 2003 06:05:50 +0900, > Dave Dembinski wrote:

Running OS X 10.2.4, trying to make use of Akimichi Tatsukawa’s
LibNeural package. I downloaded Swig 1.3.9 and built it from source
(it’s the version listed on the LibNeural page as having been used to
test it), with no errors I could see. The LibNeural package also
built with no errors, but when I ran the test scripts I got a whole
mess of undefined symbol errors like so:

ruby odd_even.rb
dyld: ruby Undefined symbols:
__ZNSi7getlineEPcic
__ZNSiC4EPSt15basic_streambufIcSt11char_traitsIcEE
__ZNSiD4Ev
__ZNSirsERf
__ZNSirsERi
__ZNSoC4EPSt15basic_streambufIcSt11char_traitsIcEE
__ZNSoD4Ev
__ZNSolsEPFRSoS_E
__ZNSolsEd
__ZNSolsEl
__ZNSolsEm
__ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode
__ZNSt13basic_filebufIcSt11char_traitsIcEE5closeEv
__ZNSt13basic_filebufIcSt11char_traitsIcEEC1Ev
__ZNSt13basic_filebufIcSt11char_traitsIcEED4Ev
__ZNSt8ios_base4InitC1Ev
__ZNSt8ios_base4InitD1Ev
__ZNSt8ios_baseC2Ev
__ZNSt8ios_baseD2Ev
__ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E
__ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate
__ZNSt9basic_iosIcSt11char_traitsIcEED4Ev
__ZSt4cout
_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6
__ZSt9terminatev
__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3
__ZTTSt14basic_ifstreamIcSt11char_traitsIcEE
__ZTTSt14basic_ofstreaTrace/BPT trap

Has anyone run into anything similar on OS X or anywhere else for that
matter? I searched the newsgroup but the only thing I found relating
to LibNeural was a release announcement.

Thanks,
_dave