Forums Archived

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

Can't get rubygame to work

Get help and support with Rubygame

Can't get rubygame to work

Postby DarkMetatron » Sun Sep 27, 2009 2:09 pm

Hello,

I am new to ruby and rubygame and have tried to get http://rubygame.org/wiki/Generic_Game_Template to work as a starting point, but I only get this error:

/usr/lib64/ruby/gems/1.8/gems/rubygame-2.5.3/lib/../ext/rubygame/rubygame_core.so: /usr/lib64/ruby/gems/1.8/gems/rubygame-2.5.3/lib/../ext/rubygame/rubygame_core.so: undefined symbol: SDL_FreeSurface - /usr/lib64/ruby/gems/1.8/gems/rubygame-2.5.3/lib/../ext/rubygame/rubygame_core.so (LoadError)
from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib64/ruby/gems/1.8/gems/rubygame-2.5.3/lib/rubygame.rb:34
from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from main.rb:2

I have all dependencies for rubygame installed.
I use Gentoo Linux with a 32/64bit multilib profile. SDL, ruby and rubygame are compiled as 64bit app.

I hope somebody can help me.
DarkMetatron
 
Posts: 4
Joined: Sun Sep 27, 2009 1:51 pm

Re: Can't get rubygame to work

Postby shawn42 » Mon Sep 28, 2009 6:44 pm

If I had to guess, I'd ask if your SDL is compiled in 64bit? Your ruby obviously is.

What's the output of sdl-config?
Code: Select all
sdl-config --prefix --version --libs --cflags --exec-prefix


Also, can you list all the SDL libs you have installed? (I forget how to do that in gentoo-land, it's been a few years since I've used it)
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Can't get rubygame to work

Postby DarkMetatron » Mon Sep 28, 2009 6:52 pm

SDL should be 64bit, because all other apps that use sdl on my Boy are 64bit and linked against it.

DarkStation metatron # sdl-config --prefix --version --libs --cflags --exec-prefix
Code: Select all
/usr
1.2.13
-lSDL -lpthread
-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
/usr

Installed are (with version)
Code: Select all
=media-libs/sdl-mixer-1.2.8
=media-libs/sdl-pango-0.1.2
=media-libs/sdl-ttf-2.0.9
=media-libs/sdl-gfx-2.0.20
=media-libs/libsdl-1.2.13-r1
=media-libs/sdl-sound-1.0.3
=media-libs/sdl-net-1.2.7
=media-libs/sdl-image-1.2.7-r1
=dev-perl/sdl-perl-2.2.2.7
DarkMetatron
 
Posts: 4
Joined: Sun Sep 27, 2009 1:51 pm

Re: Can't get rubygame to work

Postby jacius » Mon Sep 28, 2009 7:46 pm

Could you paste the output from this command?
Code: Select all
ldd /usr/lib64/ruby/gems/1.8/gems/rubygame-2.5.3/ext/rubygame/rubygame_core.so

I'm curious to see if Rubygame linked to the correct SDL library. Do you have a 32-bit version of SDL that it might have accidently linked to?
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: Can't get rubygame to work

Postby DarkMetatron » Mon Sep 28, 2009 7:50 pm

Code: Select all
DarkStation metatron # ldd /usr/lib64/ruby/gems/1.8/gems/rubygame-2.5.3/ext/rubygame/rubygame_core.so
        linux-vdso.so.1 =>  (0x00007fffc05ff000)
        libruby18.so.1.8 => /usr/lib64/libruby18.so.1.8 (0x00007f2a9ebef000)
        libc.so.6 => /lib/libc.so.6 (0x00007f2a9e867000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f2a9e64a000)
        librt.so.1 => /lib/librt.so.1 (0x00007f2a9e441000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f2a9e23d000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f2a9e004000)
        libm.so.6 => /lib/libm.so.6 (0x00007f2a9dd82000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2a9f118000)


Yes, I have 32bit sdl installed too. for a few games that need 32bit sdl.
Should I uninstall it to see if it helps?
DarkMetatron
 
Posts: 4
Joined: Sun Sep 27, 2009 1:51 pm

Re: Can't get rubygame to work

Postby jacius » Tue Sep 29, 2009 3:40 am

No, you don't need to uninstall the 32-bit version. The output from ldd is showing that Rubygame isn't linked to SDL at all, which explains why it can't find an SDL function. :shock:

Please recompile Rubygame using the following command, then paste the output to a pastebin service (like Pastie) and post the URL back here.

Code: Select all
rake clobber verbose build

("clobber" forces a recompile, and "verbose" makes it output the full compile commands.)
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

[SOLVED] Can't get rubygame to work

Postby DarkMetatron » Tue Sep 29, 2009 8:34 am

Its done:
Link to the Pastie

After looking over the output of rake clobber and ldd for a time I build it again without -as-needed in my LDFLAGS and now everything works.

Thanks for your great help.
DarkMetatron
 
Posts: 4
Joined: Sun Sep 27, 2009 1:51 pm

Re: Can't get rubygame to work

Postby shawn42 » Tue Sep 29, 2009 1:15 pm

jacius triumphs again! :lol:
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Can't get rubygame to work

Postby jacius » Wed Sep 30, 2009 4:28 am

Cool, glad you got it working. :)
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