Forums Archived

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

Rubygame in ruby 1.9.1 land

Get help and support with Rubygame

Rubygame in ruby 1.9.1 land

Postby shawn42 » Tue Feb 10, 2009 9:07 pm

I have tested the new version of rubygame 2.4.1 with ruby 1.9.1 and found it to work fine. The only problem I had was that the rsdl that was built following the install instructions for OS X from http://rubygame.sourceforge.net/doc/2_2_0/files/doc/macosx_install_rdoc.html. This rsdl worked with ruby 1.8 but not ruby 1.9.

I also found that a lot of C code that includes ruby.h does not have HAVE_STRUCT_TIMESPEC defined. Which results in a double definition error.

Here is the updated rsdl.c code:
Code: Select all
#include <SDL.h>
#include <SDL_main.h>
#define HAVE_STRUCT_TIMESPEC 1
#include <ruby.h>

int main(int argc, char* argv[])
{
  // 1.8
   // ruby_init();
   // ruby_options(argc, argv);
   // ruby_run();

  // 1.9 ness
  RUBY_INIT_STACK;
  ruby_init();
  return ruby_run_node(ruby_options(argc, argv));
}
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm

Re: Rubygame in ruby 1.9.1 land

Postby shawn42 » Mon Mar 02, 2009 8:41 pm

Interesting update from ruby-talk mailing list:

Hi,

At Tue, 3 Mar 2009 02:23:47 +0900,
Jeff Schwab wrote in [ruby-talk:330122]:
> $ echo '#include "ruby.h"' >main.c
> $ gcc -c main.c

You need to add -I option for platform specific headers, maybe
-I $HOME/usr/include/`uname -m`-darwin`uname -r`. mkmf.rb
should deal with it.

Apple has added a strange hack to gcc in their port so it reads
ruby/missing.h from
/System/Library/Frameworks/ruby.framework/Headers/config.h.

--
Nobu Nakada
User avatar
shawn42
 
Posts: 109
Joined: Tue Feb 10, 2009 8:22 pm


Return to Help & Support

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron