ohai / ruby-sdl2

A Ruby wrapper for SDL 2.x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SDL's ttf, mixer and image modules are not built on MacOS

ellmo opened this issue · comments

installed required packages via homebrew:

brew install sdl_image sdl_mixer sdl_ttf sdl

Tried installing the gem both with gem/bundler and rake gem. The gem builds fine, is included in gem list, accessible via Gemfile in a bundler-enabled project and we got:

require "sdl2"

SDL2::Window
#=> SDL2::Window
SDL2::GL
#=> SDL2::GL
SDL2::MessageBox
#=> SDL2::MessageBox

BUT...

SDL2::TTF
#=> NameError: uninitialized constant SDL2::TTF
SDL2::Image
#=> NameError: uninitialized constant SDL2::Image
SDL2::Mixer
#=> NameError: uninitialized constant SDL2::Mixer

I'm not sure why none of those packages raise problems while building. Perhaps you chose to ignore errors and squelch warnings by default.

Are there some paths/envars/options that can be provided while building / compiling the gem to point to exact locations of those libraries?

commented

Probably you should install sdl2_* packages (sdl2_image, ..) instead by homebrew. Please try it.

Hey, took me a while to remember about my little project.

As you see I have been an idiot this whole time and – yes – I had the main sdl2 library and a bunch of sdl1 extensions.
No wonder it no worky.

It's all working now after cleaning up my homebrew mess and reinstalling the gem.