Library 'SDL3' not found (macOS)

Hi there, complete Odin beginner here. I’m looking to tinker with a simple game idea, and was able to build and run the GLFW example from the Odin overview documentation without issue. Yay!

I can similarly create a basic Raylib window with Karl Zylinski’s example code.

But when I try a basic SDL3 example for comparison:

package main

import "core:fmt"
import SDL "vendor:sdl3"

main :: proc() {
    if !SDL.Init({.VIDEO}) {
        fmt.eprintln("Failed to initialize SDL:", SDL.GetError())
        return
    }
    defer SDL.Quit()
}

I get:

$ odin version
odin version dev-2025-04-nightly:d9f990d
$ odin run .
ld: library 'SDL3' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What am I doing wrong? Is SDL3 bundled with Odin differently than GLFW and Raylib? I assume I’m misunderstanding something basic.

If it helps, I’m on macOS 15.4.1 (ARM), and I installed Odin by just downloading the latest stable release from GitHub, extracting dist.tar adding the folder to my PATH, and then running xattr -d com.apple.quarantine on the odin executable and the libs for libLLVM/libz3/libzstd to resolve the macOS quarantine issues. Thanks in advance.

SDL3 wants you to dynamically link it, opposed to Raylib. So for SDL3 we ask the linker for sdl3, and as you can see it can’t find it, usually meaning you haven’t installed it.

The easiest way to do that on MacOS is using brew install sdl3, after doing that it should just work.