Cannot Compile SDL app in VC++6

Started by
2 comments, last by Iron Eye 20 years, 5 months ago
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:

#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)
---
ConPong _//_ Google _//_ Chaos Forge - quick and easy file hosting for developers

"Games usually keep me from making my own..."
-Me
---



find your elementat mutedfaith.com.
Advertisement
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]
2 + 2 = 5 for extremely large values of 2
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 argc, char *argv[] fixed it.
---
ConPong _//_ Google _//_ Chaos Forge - quick and easy file hosting for developers

"Games usually keep me from making my own..."
-Me
---



find your elementat mutedfaith.com.

This topic is closed to new replies.

Advertisement