I have three image files, one is Techs.png, one is Techs.gif and one is Techs.bmp. I have used SDL_image 2.0.5 and SDL 2. When I load the image of Techs.gif and Techs.bmp, there is no error, but when I load the image of Techs.png. SDL_Surface*Surface=IMG_Load("Techs.png"), an error occurs, I cannot load this image and Surface always returns NULL, I am using Visual Studio 2019. Can someone help me, thanks.
When in doubt, make sure you read the documentation for the functions you use. There are sometimes hidden gems and very useful tips there.
In this case, we can see that there is a function called
IMG_GetError() which should be used to retrieve a human readable message of the error you got.
Using this, you'll be able to narrow down the possible sources of issues.