gosu / ashton

Special graphical effects and other extensions for the Ruby/Gosu game library (⚠️ unmaintained)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error installing on OSX Mavericks

stephenbinns opened this issue · comments

I'm having some issues compiling the native extensions on mavericks - am I missing a dependency?

Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Using gosu 0.8.6
Using opengl 0.9.1

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating extconf.h
creating Makefile

make "DESTDIR="
compiling ashton.c
In file included from ashton.c:8:
In file included from ./ashton.h:15:
In file included from ./common.h:7:
./GLee.h:760:20: error: typedef redefinition with different types ('ptrdiff_t' (aka 'int') vs 'intptr_t' (aka 'long'))
        typedef ptrdiff_t GLintptrARB;
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:55:18: note: previous definition is here
typedef intptr_t GLintptrARB;
                 ^
In file included from ashton.c:8:
In file included from ./ashton.h:15:
In file included from ./common.h:7:
./GLee.h:761:20: error: typedef redefinition with different types ('ptrdiff_t' (aka 'int') vs 'intptr_t' (aka 'long'))
        typedef ptrdiff_t GLsizeiptrARB;
                          ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gltypes.h:56:18: note: previous definition is here
typedef intptr_t GLsizeiptrARB;
                 ^
2 errors generated.
make: *** [ashton.o] Error 1

Im running with ruby version:

ruby -v                                                                                     
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin]

I believe this is the default now?

I'm not sure about that. I haven't been actively working on Ashton since 1.9.3. I assume something has changed in the ruby c API since then, but the fix should be simple. I recommend you work with 1.9.3, when using Ashton, until this can be resolved.

Oops no, that is actually an issue with using 64 bit ruby, not with the version itself. Can you try cloning the repo and using this to prevent it trying to set those values?
<code="ruby">
#ifndef ptrdiff_t
typedef ptrdiff_t GLwhatever
#endif

Otherwise, I can try to sort it next week.

I went for a simple solution. Changed the types to be long. Now it compiles (and runs) correctly for me on Ubuntu (Ruby 1.9.3/64bit), OSX (Ruby 2.0.0/64bit) and Windows 7 (Ruby 1.9.3/32bit). Tell me if it fails elsewhere...

Pushed to rubygems as v0.1.5

Thanks for your bug report and attempts to fix it!

Thanks for getting this fixed ⭐