Reputation: 11
I'm trying to make a game on visual studio 2013 with SDL.
when I'm typed :
SDL_Surface* pTempSurface = IMG_Load("assets/na.png"); <br><br>
error occurred like :
Error 2 error LNK2019: unresolved external symbol _IMG_Load referenced in function
I already check project properties, c/c++,linker Additional Include/Library Directories
and I also checked Linker|Input|Addtional Dependencies
, header files, place dll files to excutable folder too.
I don't know why this problem happened.
Can anyone tell me what should I do?
Upvotes: 0
Views: 2851
Reputation: 1378
This is a linking problem, which means that when Visual Studio is trying to link you code to the already compiled SDL_image one, it is not finding the binary for this method.
The only way to solve this is by checking the following:
Project -> Properties-> VC++Directories -> Library Directories
Project -> Properties -> Linker -> Input -> Additional Dependencies (SDL_image.lib)
If the problem were a missing DLL, it would crash on runtime. It it were a missing header, it would give a compiler error saying that the IMG_Load was not defined.
Upvotes: 1