Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL Setup in VS 2013

Started by Morley Nov 30, 2014 at 10:22 PM 1 replies 2.9k views
Original Post
Morley
Morley

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

Morley

Aspiring programmer, modeler and game designer.
Morley
Morley

This issue has been resolved. Thanks.

Morley

Aspiring programmer, modeler and game designer.
fastcall22
fastcall22
The issue OP may have solved is that "SDL.lib" (or "SDL2.lib") might have been missing from the "additional dependencies" field in the project's linker properties.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.