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
unresolved external symbol _stbi_load #3
Comments
From stb_image.h: Do this: |
I missed that line... I did that in my Utils.h file. Now I'm trying to access the functions in another file that is including Utils.h but I still get errors:
I've checked and the fname.obj are all the files referencing Utils.h |
That's because STB_IMAGE_IMPLEMENTATION needs to be defined within a .c or .cpp file, not within a header. When you define STB_IMAGE_IMPLEMENTATION, you are creating the bulk of the stb_image code. You only want that code to exist once, like the code in your own project, which is why it has to be defined within a .c or .cpp file. |
Thanks, solved it! |
* Rename stb_image.c to stb.c * Update CMakeLists.txt
I'm using Visual Studio and the stb_image.h library.
If I call stbi_load in my program I get the following errors:
The text was updated successfully, but these errors were encountered: