SDL Init problem

Hi.
just want to link and init sdl library to project.
do all steps from http://lazyfoo.net/SDL_tutorials/lesson01/windows/msvsnet2010e/index.php
download library.
create new empty project
set include and lib directories in properties (include and x64)
edit the additional dependencies - SDL.lib; SDLmain.lib
set the Subsystem to be Windows
create main.cpp
1
2
3
4
5
6
#include "include\SDL.h"
int main( int argc, char* args[] ) 
{ 
	SDL_Init( SDL_INIT_EVERYTHING );  
	return 0; 
}

set "Runtime Library" to Multi-Threaded DLL
and run.

Linker gived me
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
at first.
i set "entry point" - main
it gived
error LNK2019: unresolved external symbol _SDL_Init referenced in function _SDL_main
and
error LNK2001: unresolved external symbol _main
if i write
 
#undef main; 

the last error goes away.
i'm not sure, that my last steps is right...

but one error...
error LNK2019: unresolved external symbol _SDL_Init referenced in function _main
what can i do with this?
somebody told me, that's problem, caused i skipped one step in linking... but i did all steps, i know.
whats a matter? help)
and sorry for my english))



Did you add the libs under linker> input?
yes. linker-> input-> additional dependencies -> SDL.lib; SDLmain.lib
it's all? or not?
You have to link the include folder, the lib folder, and then put the .dlls where the .exe is for the program.

Edit then put a flag of something like this -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_ttf

Depending if you want the main function , images and true text fonts.


Actually don't even listen to me I guess it is a lot different in Microsoft visual then code::blocks sorry. I haven't used visual with sdl or for anything really.
Last edited on
Topic archived. No new replies allowed.