Polytonic / Glitter

Dead Simple OpenGL
http://polytonic.github.io/Glitter/
2.45k stars 417 forks source link

XCode project not found stbi_load function #66

Open stefanJi opened 3 years ago

stefanJi commented 3 years ago

I hava used cmake -G "Xcode" .. to generate a xcode project and usage as follow:

u_char *data = stbi_load(imagePath, &width, &height, &nrChannels, 0);

but compiler make a error: No matching function for call to 'stbi_load'

I have changed glitter.hpp to:

#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
Polytonic commented 3 years ago

Mmm, I don't seem to have this issue locally. Which version of macOS are you running?

stefanJi commented 3 years ago

10.15.6

raiyansayeed commented 3 years ago

Did you add

#define STB_IMAGE_IMPLEMENTATION

to the top of your main.cpp file? I was getting a similar error but that fixed it for me.

bigmat18 commented 4 months ago

Hi, I have the same problem, did you solve it?