Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Iron Eye

Cannot Compile SDL app in VC++6

This topic is 5330 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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)

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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[])

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!