Hello, i am trying to use SDL but my IDE (VIsual c++ 2010) wont link SDL properly. I have tries making new projects, moving the folders, and re downloading it. Nothing worked. I am following Lazy Foos tutorials but im cannot get this stupid thing to work.
My code:
#include "SDL.h"
int main(){
SDL_Init(SDL_INIT_VIDEO);
SDL_Quit();
return 0;
}
My errors:
1>------ Build started: Project: SpaceShooter, Configuration: Debug Win32 ------
1> Main.cpp
1>Main.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ)
1>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\Mathew\documents\visual studio 2010\Projects\SpaceShooter\Debug\SpaceShooter.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I hate this so much. I followed the tutorial to the letter, i re read it multiple times, and then googled it. I looked for a youtube tutorial Nothing worked. Please im desperate, i need help!
SDL pisses me off
The errors you posted are unrelated to your code. These are linker errors, not compiler errors.
Did you link to SDL?
How?
L. Spiro
Did you link to SDL?
How?
L. Spiro
I followed the instructions on Lazy foo's website, http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet2010e/index.php. In the properties i added the path for the include and lib folder. then i changed the runtime library to Multi-Threaded dll. ANd then, under the linker section, i added SDL.lib and SDLmain.lib to the additional dependencies. I also changed the subsystem to Windows (/SUBSYSTEM:WINDOWS). I inputted the code he game me, then i got all those errors.
What is the full path to SDLmain.lib? Copy-paste it.
What is the path you entered into your Library Directories? Copy-paste it.
What did you paste under Additional Dependencies? Copy-paste it.
L. Spiro
What is the path you entered into your Library Directories? Copy-paste it.
What did you paste under Additional Dependencies? Copy-paste it.
L. Spiro
There was no path t SDLmain.lib, i just put it in the additional Dependencies SDL.lib;SDLmain.lib;%(AdditionalDependencies):
Library directories: C:\SDL-1.2.15\lib\x64;$(LibraryPath)
Library directories: C:\SDL-1.2.15\lib\x64;$(LibraryPath)
That doesn’t answer my question.
What is the path to SDLmain.lib? Open Explorer and browse to the file. Copy-paste its path.
L. Spiro
What is the path to SDLmain.lib? Open Explorer and browse to the file. Copy-paste its path.
L. Spiro
Oh. Its in here C:\SDL-1.2.15\lib\x64, i had moved the Folders around from when i first posted this but i updated the project.
You are compiling for a Win32 configuration, but the library you're linking to is x64 judging by your library folder. You should link against the Win32 (x86) version of the library
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement