Sign in to follow this  

SDL Setup in VS 2013

This topic is 1108 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

Hey all,

 

I'm relatively new to C++ and VS 2013, so bear with me. A majority of my experience in programming has been in Java.

 

My end goal here is to make a very rough Missile Command clone just to get a feel for how things work in C++ and SDL.

 

I've been following along with this tutorial to get things set up, since I know nothing about how C++ compilers function and so on (I'm working on learning it).

 

The problem is, I'm having some difficulties with the linker. Copied below is the error output when I go to build.

 

1>------ Build started: Project: MissileCommand, Configuration: Debug x64 ------
1>MissileCommand.obj : error LNK2019: unresolved external symbol SDL_GetError referenced in function SDL_main
1>MissileCommand.obj : error LNK2019: unresolved external symbol SDL_Init referenced in function SDL_main
1>MissileCommand.obj : error LNK2019: unresolved external symbol SDL_Quit referenced in function SDL_main
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
1>F:\GameDev\MissileCommand\x64\Debug\MissileCommand.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And here is the little test code (provided in the tutorial link) that I used:

 

#include <iostream>
#include <SDL.h>

int main(int argc, char **argv){
	if (SDL_Init(SDL_INIT_EVERYTHING) != 0){
		std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
		return 1;
	}
	SDL_Quit();

	return 0;
}

I'm guessing I missed something in the tutorial, but I'm not quite sure what. I'll continuing tinkering and post back if I find the solution.

 

Thanks,

Morley

 

Share this post


Link to post
Share on other sites

This topic is 1108 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this