Forums Archived

The forums are being archived. See this topic for more information.

so many warnings.

Get help and support with Rubygame

so many warnings.

Postby Craig` » Sun Nov 22, 2009 8:33 pm

Hey, I'm brand spanking new to Rubygame.

I was originally having trouble installing rubygame so I hopped over to #rubygame at irc.freenode.net, Shawn helped me and provided me with a lot of packages that I ought to install, and here's a list of those commands that I typed:

1. sudo gem install rubygame
2. libsdl1.2-all
3. libsdl1.2-dev
4. libsdl-gfx1.2-dev
5. libsdl-image1.2-dev
6. libsdl-mixer1.2-dev
7. libsdl-ttf2.0-dev

and here's my code...

Code: Select all
#!/user/bin/ruby -w

require "rubygems"
require "rubygame"

Rubygame.init
screen = Rubygame::Screen.new [640, 400]

loop {}


and here's the warnings that I get...

craig@craig:~$ ruby my_game.rb
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/audio.rb:47: warning: method redefined; discarding old callback=
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/audio.rb:52: warning: method redefined; discarding old callback
/home/craig/.gem/ruby/1.8/gems/nice-ffi-0.2/lib/nice-ffi/opaquestruct.rb:51: warning: instance variable @typed_pointer not initialized
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:73: warning: method redefined; discarding old seek=
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:78: warning: method redefined; discarding old seek
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:82: warning: method redefined; discarding old read=
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:87: warning: method redefined; discarding old read
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:91: warning: method redefined; discarding old write=
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:96: warning: method redefined; discarding old write
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:100: warning: method redefined; discarding old close=
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl/rwops.rb:105: warning: method redefined; discarding old close
/home/craig/.gem/ruby/1.8/gems/nice-ffi-0.2/lib/nice-ffi/library.rb:54: warning: discarding old func
/home/craig/.gem/ruby/1.8/gems/nice-ffi-0.2/lib/nice-ffi/library.rb:55: warning: discarding old var
/home/craig/.gem/ruby/1.8/gems/ruby-sdl-ffi-0.2/lib/ruby-sdl-ffi/sdl.rb:49: warning: redefine sdl_func
Warning: Function 'SDL_gfxBlitRGBA' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'SDL_gfxSetAlpha' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'arcColor' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'arcRGBA' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'texturedPolygon' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'filledPolygonColorMT' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'filledPolygonRGBAMT' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'texturedPolygonMT' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'shrinkSurface' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'rotateSurface90Degrees' not found in [/usr/lib/libSDL_gfx.so]
/home/craig/.gem/ruby/1.8/gems/nice-ffi-0.2/lib/nice-ffi/opaquestruct.rb:51: warning: instance variable @typed_pointer not initialized
/home/craig/.gem/ruby/1.8/gems/nice-ffi-0.2/lib/nice-ffi/opaquestruct.rb:51: warning: instance variable @typed_pointer not initialized
^Cmy_game.rb:9:in `loop': Interrupt
from my_game.rb:9


so can someone help me battle all of these warnings please :)? it's just that I'm wanting to eliminate these errors before I attempt to "start" (as-such) development with rubygame :)
Craig`
 
Posts: 1
Joined: Sun Nov 22, 2009 8:27 pm

Re: so many warnings.

Postby jacius » Tue Nov 24, 2009 10:09 pm

These messages indicate that you are using an old version of SDL_gfx, so certain functions aren't available:

Warning: Function 'SDL_gfxBlitRGBA' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'SDL_gfxSetAlpha' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'arcColor' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'arcRGBA' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'texturedPolygon' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'filledPolygonColorMT' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'filledPolygonRGBAMT' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'texturedPolygonMT' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'shrinkSurface' not found in [/usr/lib/libSDL_gfx.so]
Warning: Function 'rotateSurface90Degrees' not found in [/usr/lib/libSDL_gfx.so]

But, none of those are used by Rubygame, so you should have no trouble. :)

I don't think Ubuntu (or Debian) even has the latest version of SDL_gfx available, so if you are really bothered by those warnings, you will need to compile and install SDL_gfx from source on your own. But as I said, those functions aren't even used in Rubygame, so you don't have to do anything.

The other warnings you pasted are harmless, just Ruby complaining about my sloppy code. You can ignore them. :lol:
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron