Barret5Ocal
Barret Gaylor
21 posts
I am a game designer who recently became interested in coding in a handmade way. I am not that experienced, but I want to learn. |
#7011
What am I doing wrong? 2 years, 9 months ago
I have been trying to use stb_image.h but I am running into some errors that I don't understand. Can some one help me figure it out.
These are the errors I got: f:\stb\stb_image.h(4503): error C2220: warning treated as error - no 'object' file generated f:\stb\stb_image.h(4503): warning C4244: '=': conversion from 'int' to 'stbi__uint16', possible loss of data f:\stb\stb_image.h(5082): warning C4244: 'initializing': conversion from 'int' to 'stbi__uint16', possible loss of data f:\stb\stb_image.h(5089): warning C4244: '=': conversion from 'int' to 'stbi_uc', possible loss of data f:\stb\stb_image.h(5090): warning C4244: '=': conversion from 'int' to 'stbi_uc', possible loss of data f:\stb\stb_image.h(5091): warning C4244: '=': conversion from 'int' to 'stbi_uc', possible loss of data win32_handmade.cpp f:\stb\stb_image.h(4503): error C2220: warning treated as error - no 'object' file generated f:\stb\stb_image.h(4503): warning C4244: '=': conversion from 'int' to 'stbi__uint16', possible loss of data f:\stb\stb_image.h(5082): warning C4244: 'initializing': conversion from 'int' to 'stbi__uint16', possible loss of data f:\stb\stb_image.h(5089): warning C4244: '=': conversion from 'int' to 'stbi_uc', possible loss of data f:\stb\stb_image.h(5090): warning C4244: '=': conversion from 'int' to 'stbi_uc', possible loss of data f:\stb\stb_image.h(5091): warning C4244: '=': conversion from 'int' to 'stbi_uc', possible loss of data Any help would be helpful. Thank you. Just some designer guy. |
aidanb
Aidan
10 posts
|
#7014
What am I doing wrong? 2 years, 9 months ago
So it looks like you're building with the -W4 (warning level 4) and -WX (treat warnings as errors) flags turned on, and stb_image has a few internal warnings, which then get treated as errors by your compiler. They're simple warnings to fix, so they should probably be cleaned up by Sean at some point. In the mean time, you have a couple of options.
You could drop your warning level down to 3, or stop compiling with warnings as errors (This probably isn't what you want to do) You could disable the warning by adding -wd4244 to your build. You can fix the warnings by changing these lines in stb_image.h
|
Barret5Ocal
Barret Gaylor
21 posts
I am a game designer who recently became interested in coding in a handmade way. I am not that experienced, but I want to learn. |
#7015
What am I doing wrong? 2 years, 9 months ago
Thank you. Its working now.
Just some designer guy. |
dbechrd
Dan
21 posts
A man named Dan. |
#7364
What am I doing wrong? 2 years, 8 months ago aidanb Perhaps you could submit a pull request with your fixes to save Sean the effort? Dan was here. |