The question in the online by many netizens questions, you have given a variety of answers. I have also encountered this problem in the SDL multimedia library. After a good burst of exploration, we finally found the answer.
Under normal circumstances, after compiling the SDL header files and libraries, simply point the header file to the correct location with the library file path. Then add the header files, libraries, you can use directly.
In general, the use of static libraries for SDL.lib, SDLmain.lib, dynamic library is SDL.dll, the header file is SDL.h.
If you use the following in your project:
#include <SDL.h>
#pragma comment (lib, "SDL.lib")
int main ()
{
...
}
The above link error will occur. The original because of lack of library SDLmain.lib. That is, the following scenario is correct.
#include <SDL.h>
#pragma comment (lib, "SDL.lib")
#pragma comment (lib, "SDLmain.lib")
int main ()
{
...
}