Polytonic / Glitter

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

stbi load not working on macOS, linker problems #70

Open drs-m opened 3 years ago

drs-m commented 3 years ago

trying to use 'stbi_load' does not work in CLion on MacOS. did a fresh clone of master. include_directories contains the stb Vendor folder.

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

Polytonic commented 3 years ago

Hmm, I've never tried using CLion. Does it compile if you use a standard makefile?

ACE199704 commented 3 years ago

https://github.com/Polytonic/Glitter/issues/32 this is the way to solve the problem. // Reference: https://github.com/nothings/stb/blob/master/stb_image.h#L4 // To use stb_image, add this in one C++ source file. // #define STB_IMAGE_IMPLEMENTATION

include

===== // add these in your "main.cpp" C++ source file

define STB_IMAGE_IMPLEMENTATION

include

=====

DevelopmentHF commented 1 year ago

did you find a solution?

PegasusXing commented 10 months ago

That was the solution...