Glitter icon indicating copy to clipboard operation
Glitter copied to clipboard

XCode project not found stbi_load function

Open stefanJi opened this issue 5 years ago • 4 comments

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>

stefanJi avatar Sep 08 '20 11:09 stefanJi

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

Polytonic avatar Sep 13 '20 00:09 Polytonic

10.15.6

stefanJi avatar Sep 13 '20 03:09 stefanJi

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.

raiyansayeed avatar Sep 23 '20 03:09 raiyansayeed

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

bigmat18 avatar Mar 08 '24 18:03 bigmat18