Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Gosu Running Error
- - By kotakotakota Date 2010-07-18 19:06
Hello,

I am new to both Ruby and Gosu.  (I have been programming in C++ for over 5 years now, as well as in many other languages, but had never had the time to learn Ruby up until now.)  I am running openSUSE 11.3 (64 bit), and I have installed Ruby 1.8.7 as well as Gosu 7.22 (through RubyGems).  As a test, I copied and pasted in the first application in the Gosu Ruby tutorial, and added "require 'rubygems'" to the beginning:

require 'rubygems'
require 'gosu'

class GameWindow < Gosu::Window
  def initialize
    super(640, 480, false)
    self.caption = "Gosu Tutorial Game"
  end

  def update
  end

  def draw
  end
end

window = GameWindow.new
window.show

When I try to run the application, I get the following error:

/home/kota/.gem/ruby/1.8/gems/gosu-0.7.22/lib/gosu.so: /home/kota/.gem/ruby/1.8/gems/gosu-0.7.22/lib/gosu.so: undefined symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE - /home/kota/.gem/ruby/1.8/gems/gosu-0.7.22/lib/gosu.so (LoadError)
        from /usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in require'
        from /home/kota/.gem/ruby/1.8/gems/gosu-0.7.22/lib/gosu.rb:12
        from /usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in
gem_original_require'
        from /usr/lib64/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /home/kota/NetBeansProjects/HelloGosu/lib/main.rb:2

I have also tried installing it from source, under openSUSE 11.2, and under Ubuntu 10.04, and several different versions of Gosu, all without luck.

If anyone could give me a pointer to what I am doing wrong, I would highly appreciate it!
Thanks!
Parent - - By jlnr (dev) Date 2010-07-18 20:56
Welcome to the boards :)

This is weird, I tested Gosu on Ubuntu 10.04 64-bit just recently. Seems to be some difference between libstdc++ and libstdcxx. Is there any way for you to make sure that Ruby and Gosu are being built against the same library? Also, a quick google yielded lots of hits for a "compat-libstdc++" library. Can you give that a try?

BTW: What do you mean installing it from source? Did you just 'make' Gosu (which should not do any Ruby stuff), or actually build the gem via rake? In any case, using the gem should actually be the safest way to install Gosu. Do other C++ gems work, for example eventmachine?
Parent - By kotakotakota Date 2010-07-19 21:43
I will try compiling Ruby (1.9.2 RC2) using g++ and seeing if that changes anything.

I used both make and rake.

Thanks for all the help, will keep posted.
- - By kotakotakota Date 2010-07-20 15:11
Hmm ok, so I tried doing a make and make install under my openSUSE 11.3 machine (I want to get familiar with Gosu first in C++ as that is my 'native tongue') and I was hit with the following error:

/tmp/ccccW7hN.o: In function main':
Tutorial.cpp:(.text+0x66): undefined reference to
Gosu::Sample::~Sample()'
/tmp/ccccW7hN.o: In function GameWindow::update()':
Tutorial.cpp:(.text._ZN10GameWindow6updateEv[GameWindow::update()]+0x3c8): undefined reference to
Gosu::Sample::play(double, double, bool) const'
/tmp/ccccW7hN.o: In function GameWindow::~GameWindow()':
Tutorial.cpp:(.text._ZN10GameWindowD2Ev[_ZN10GameWindowD5Ev]+0x4e): undefined reference to
Gosu::Sample::~Sample()'
/tmp/ccccW7hN.o: In function GameWindow::~GameWindow()':
Tutorial.cpp:(.text._ZN10GameWindowD0Ev[_ZN10GameWindowD5Ev]+0x4e): undefined reference to
Gosu::Sample::~Sample()'
/tmp/ccccW7hN.o: In function void boost::checked_delete<Gosu::Sample>(Gosu::Sample*)':
Tutorial.cpp:(.text._ZN5boost14checked_deleteIN4Gosu6SampleEEEvPT_[void boost::checked_delete<Gosu::Sample>(Gosu::Sample*)]+0xa): undefined reference to
Gosu::Sample::~Sample()'
/tmp/ccccW7hN.o: In function GameWindow::GameWindow()':
Tutorial.cpp:(.text._ZN10GameWindowC2Ev[_ZN10GameWindowC5Ev]+0x228): undefined reference to
Gosu::Sample::Sample(Gosu::Audio&, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'
Tutorial.cpp:(.text._ZN10GameWindowC2Ev[_ZN10GameWindowC5Ev]+0x242): undefined reference to `Gosu::Sample::~Sample()'
collect2: ld returned 1 exit status
make: *** [/home/kota/SDK/Gosu/gosu/linux/../examples/Tutorial] Error 1

Any ideas? I am using GNU gcc 4.5
Thanks!
Parent - - By jlnr (dev) Date 2010-07-21 11:37 Edited 2010-07-21 11:42
So apparently the Gosu makefile looks for SDL_mixer in two places which are:

> if test -f "/usr/lib/libSDL_mixer.so" || test -f "/usr/local/lib/libSDL_mixer.so"; then


I guess it just shouldn't check at all. There is no implemented alternative to SDL_mixer on Linux anymore anyway.

Do you have SDL mixer installed?
Parent - - By kotakotakota Date 2010-07-21 15:18
Yes, I do (Version 1.2).  I will try to compile it in either a vm or try to compile it on one of my other machines to see if it will work.
Again, thanks for all the help.
Parent - By kotakotakota Date 2010-07-24 01:08
Excellent! I got it to work.  I downloaded and installed the newest Ruby from SVN as well as RubyGems and Gosu, and it now it seems to work fine.  Thank you very much!
Up Topic Gosu / Gosu Exchange / Gosu Running Error

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill