Skip to content

SDL2 not found when attempt to run an example on macOS #32

Description

@cjdell

This is a nice library with lots of potential, however attempting to run the examples on macOS gives the following error, despite SDL2 being installed by brew:

  = note: ld: library 'SDL2' not found

For me, the workaround is to add an explicit reference to dependency sdl2 in the project's root Cargo.toml file:

[dependencies]
...
sdl2 = { version = "0.38.0", features = ["use-pkgconfig"] }

This allows the examples to build, i.e. with:

cargo run --example texture_mapping_demo --features std

Hope this is useful information to someone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions