Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk not linking sdl2_image #47

Closed
Maskhjarna opened this issue Feb 11, 2022 · 3 comments
Closed

Sdk not linking sdl2_image #47

Maskhjarna opened this issue Feb 11, 2022 · 3 comments

Comments

@Maskhjarna
Copy link

When attempting to build on Arch Linux 5.16.8 I get this:

ld.lld: error: undefined symbol: IMG_Init

Adding this line to Sdk.zig seems to fix the problem:

// . . .

} else {
    // on linux, we should rely on the system libraries to "just work"
    exe.linkSystemLibrary("sdl2");
    exe.linkSystemLibrary("sdl2_image"); // <--
}

// . . .

Largely unfamiliar with the zig build system, so I might be doing something wrong.

@ikskuh
Copy link
Owner

ikskuh commented Feb 11, 2022

This is only right if you intend to link sdl2_image. Which is not that often the case. So this would require some kind of additional function in the Sdk.zig instead of adding it to a function that only links SDL2

@Maskhjarna
Copy link
Author

Ah makes sense. I assumed the package would also provide some indirect means of linking sdl2_image.

@ikskuh
Copy link
Owner

ikskuh commented Feb 11, 2022

Ah makes sense. I assumed the package would also provide some indirect means of linking sdl2_image.

Feel free to make a PR in the style of the Sdk for SDL_image!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants