Rust-sdl2 gfx-demo


I am trying to run the gfx-demo for rust-sdl2. Per the README I ran

cargo run --example gfx-demo --features “gfx”

and it gives the error

library not found for -lSDL2_gfx

I have installed sdl and sdl2 and the other examples not requiring gfx work. I am using macOS High Sierra if that helps and I am not used to it.


What are you planning to use sdl2 and gfx for? I have direct experience with both of them (bot not together). Recently I switched over to gfx because I found sdl2 was too limiting for my needs.


Oh, sorry! This isn’t related to the gfx crate at all. I was just confused.

This is actually a binding for the SDL2_gfx library. You can install it with brew install sdl2_gfx and that should fix it for you. If you installed SDL2 using a method other than brew though, this might not work…


Thanks, that was a simple fix. I had assumed that _gfx had been installed with sdl2 and I had tried brew install sdl_gfx before as that was what the error had said. Your suggestion worked, thanks.