So, I'm trying to use SDL for the first time and so far it has been a complete mess! I'm trying to get this to run, but everything that I have tried has failed. I have been following all the correct guides but it still will not run!
I am using Visual Studio Ultimate 2010
.
This is all the code that I am trying to run:
#include "SDL.h"
#include <iostream>
int main(int argc, char* args[]) {
// Start SDL
SDL_Init(SDL_INIT_EVERYTHING);
std::cout << "SDL has been initialized!\n";
// Quit SDL
SDL_Quit();
std::cout << "SDL has quit!" << std::endl;
return 0x0;
}
The errors that the compiler yaks back are driving me nuts! Here they are:
1>------ Build started: Project: SDL_TEST, Configuration: Debug Win32 ------
1>Build started 7/6/2013 1:21:45 PM.
1>InitializeBuildStatus:
1> Touching "Debug\SDL_TEST.unsuccessfulbuild".
1>ClCompile:
1> main.cpp
1>main.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function _SDL_main
1>main.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function _SDL_main
1>MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\Tux\documents\visual studio 2010\Projects\SDL_TEST\Debug\SDL_TEST.exe : fatal error LNK1120: 3 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.59
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Compilation fails because you are not linking with the correct libraries. You have linked with the 64bit libraries but you are trying to build a Win32 binary:
1>------ Build started: Project: SDL_TEST, Configuration: Debug Win32 ------
Linking with the 32bit libraries or switching to a Win64 binary should resolve your problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.