ohai / ruby-sdl2

A Ruby wrapper for SDL 2.x
GNU Lesser General Public License v3.0
71 stars 16 forks source link

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

Closed ellmo closed 4 years ago

ellmo commented 4 years ago

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?

ohai commented 4 years ago

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

ellmo commented 4 years ago

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.