Forums Archived

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

rubygame 2.5.2 rake build failing

Get help and support with Rubygame

rubygame 2.5.2 rake build failing

Postby arousset » Wed Jul 22, 2009 11:23 pm

Hey all,

I wonder if anyone has ever ran into this:

Code: Select all
ld: library not found for -lruby
collect2: ld returned 1 exit status
rake aborted!
Command failed. Aborting.
/Users/arousset/Desktop/rubygame-src/rakefile:69:in `try_shell'


I'm on Leopard 10.5.6 and I'm running Ruby 1.9.1 exclusively, no 1.8.

It seems the compiler can't link up my ruby library. I've tried copying my ruby header files from the ruby 1.9.1 source into the current directory as my link_command looks like this:
Code: Select all
cc -dynamic -bundle -undefined suppress -flat_namespace -lruby -L. -L/usr/local/lib -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa  -o ext/rubygame/rubygame_core.bundle ext/rubygame/rubygame_main.o ext/rubygame/rubygame_shared.o ext/rubygame/rubygame_event.o ext/rubygame/rubygame_event2.o ext/rubygame/rubygame_gl.o ext/rubygame/rubygame_joystick.o ext/rubygame/rubygame_screen.o ext/rubygame/rubygame_surface.o ext/rubygame/rubygame_clock.o


However, that's not working either. So I'm pretty much stuck at this point...

Any help or ideas would be greatly appreciated. Thanks!
arousset
 
Posts: 1
Joined: Wed Jul 22, 2009 11:20 pm

Re: rubygame 2.5.2 rake build failing

Postby jacius » Fri Jul 24, 2009 12:41 am

Hiya. This message indicates that it's not finding the compiled ruby library (different from the header):

Code: Select all
ld: library not found for -lruby

The library file should be named like "libruby*.bundle", for example "libruby-1.9.bundle". Try copying that file to the current directory, or tell the compiler where to find it using the "-L" flag in LDFLAGS. You can also use the "-I" (capital i) flag in CFLAGS to tell it where to look for headers:

Code: Select all
CFLAGS="-I/path/to/the/headers/" LDFLAGS="-L/path/to/the/libraries/" rake build

For example, if you used Fink to install Ruby 1.9.1, you would use this command (if I recall correctly):

Code: Select all
CFLAGS="-I/sw/include/" LDFLAGS="-L/sw/lib/" rake build

Hope that helps.
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: rubygame 2.5.2 rake build failing

Postby Quintus » Wed Aug 26, 2009 4:11 pm

Hi,

I'm running into the same issue on Ubuntu 9.04. I've installed my ruby via --prefix in /opt/rubies/ruby-1.9.1-p243 (+ expanded PATH environment variable to the bin subdirectory) and if I try to install (or rake build) rubygame 2.5.3 I get this message:
Code: Select all
...
Linking compiled files to create rubygame/rubygame_core.so
/usr/bin/ld: cannot find -lruby
I've tried
Code: Select all
CFLAGS="-I/opt/rubies/ruby-1.9.1-p243/include/" LDFLAGS="-L/opt/rubies/ruby-1.9.1-p243/lib/" rake build
and some variations of it, but I couldn't manage it to compile, ld does not find ruby.

Ruby version is:
Code: Select all
ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux]

Am I doing something wrong?

Marvin
Quintus
 
Posts: 3
Joined: Wed Aug 26, 2009 4:00 pm

Re: rubygame 2.5.2 rake build failing

Postby jacius » Thu Aug 27, 2009 3:51 am

Quintus wrote:Hi,

I'm running into the same issue on Ubuntu 9.04. I've installed my ruby via --prefix in /opt/rubies/ruby-1.9.1-p243 (+ expanded PATH environment variable to the bin subdirectory) and if I try to install (or rake build) rubygame 2.5.3 I get this message:
Code: Select all
...
Linking compiled files to create rubygame/rubygame_core.so
/usr/bin/ld: cannot find -lruby
I've tried
Code: Select all
CFLAGS="-I/opt/rubies/ruby-1.9.1-p243/include/" LDFLAGS="-L/opt/rubies/ruby-1.9.1-p243/lib/" rake build
and some variations of it, but I couldn't manage it to compile, ld does not find ruby.

Hi there. Can you check and make sure that "libruby.so" exists in "/opt/rubies/ruby-1.9.1-p243/lib/"?

Also, please be sure to run the version of Rake that matches that version of Ruby. It might be getting confused if Rake is using Ruby 1.8, but targetting Ruby 1.9.
User avatar
jacius
Site Admin
 
Posts: 131
Joined: Fri Feb 06, 2009 11:13 pm

Re: rubygame 2.5.2 rake build failing

Postby Quintus » Thu Aug 27, 2009 11:45 am

jacius wrote:Also, please be sure to run the version of Rake that matches that version of Ruby. It might be getting confused if Rake is using Ruby 1.8, but targetting Ruby 1.9.
I'm absolutly sure that I use the 1.9 Rake.
jacius wrote:Can you check and make sure that "libruby.so" exists in "/opt/rubies/ruby-1.9.1-p243/lib/"?
Hm. There's only a "libruby-static.a" file there... Have I to pass in special flags to ./configure when I compile Ruby to get the "libruby.so" file?

Marvin
Quintus
 
Posts: 3
Joined: Wed Aug 26, 2009 4:00 pm

Re: rubygame 2.5.2 rake build failing

Postby Quintus » Sat Aug 29, 2009 2:02 pm

OK - I managed it to successfully build now. I had to copy the "libruby-static.a" from /opt/rubies/ruby-1.9.1-p243/lib to the directory I uncompressed rubygame to and had to rename it to "libruby.a". I suspected rubyame is not recognizing the "-static" in the original filename, so I did like mentioned (it may would have worked without the copy, but I don't want to rename a Ruby file in Ruby's installation directory).

Marvin
Quintus
 
Posts: 3
Joined: Wed Aug 26, 2009 4:00 pm


Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron