#include <SDL/SDL.h>
#include <stdlib.h>
#include <stdio.h>
//using namespace std;
int main()
{
SDL_Init(SDL_INIT_VIDEO);
SDL_Quit();
return 1;
}
And here''s the error:
--------------------Configuration: SDL1 - Win32 Debug--------------------
Linking...
sdlmain.lib(SDL_main.obj) : error LNK2001: unresolved external symbol _SDL_main
Debug/SDL1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
SDL1.exe - 2 error(s), 0 warning(s)
Cannot Compile SDL app in VC++6
I''ve just started trying to use VC++ 6 here at school for the first time.
I''m trying to compile a very simple SDL app and I''m getting errors.
I''ve followed all of then instuctions on cone3d with no help.
Here''s the code:
You probably haven't linked the library files in your project. Go to Project > Settings > Link and add sdl.lib and sdlmain.lib before kernel32.lib under "Object/library modules".
If that doesn't help, do you have the SDL.dll file available to your .exe file?
[edited by - Goldfish on November 17, 2003 3:33:41 PM]
If that doesn't help, do you have the SDL.dll file available to your .exe file?
[edited by - Goldfish on November 17, 2003 3:33:41 PM]
you also need to link to SDLmain.lib if your creating a console application and you need to write you main function as
int main(int argc, char *argv[])
int main(int argc, char *argv[])
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement