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

STBI Linker Issue on mac(?) #85

Open
Sesquipedalian1 opened this issue Apr 10, 2024 · 1 comment
Open

STBI Linker Issue on mac(?) #85

Sesquipedalian1 opened this issue Apr 10, 2024 · 1 comment

Comments

@Sesquipedalian1
Copy link

Undefined symbols for architecture arm64:
"_stbi_image_free", referenced from:
_main in main-c6c8c2.o
"_stbi_load", referenced from:
_main in main-c6c8c2.o
"_stbi_set_flip_vertically_on_load", referenced from:
_main in main-c6c8c2.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I set up the stb file as
#define STB_IMAGE_IMPLENENTATION
#include<stb/stb_image.h>
because I have a separate folder with stbi to keep it the same as everything else. googling it doesn't show a solution, and I'm too dull to figure this out on my own. I tried searching for it, but I haven't seen a solution.

@lipi
Copy link

lipi commented Nov 9, 2024

I had the same issue but adding the define after the include worked:

#include <glad/glad.h>
#include <GLFW/glfw3.h>
// #define STB_IMAGE_IMPLEMENTATION -- doesn't work
#include <stb_image.h>
#define STB_IMAGE_IMPLEMENTATION // works

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