Jump to content
  • Advertisement
Sign in to follow this  
tpwild

Setting up SDL for Visual C++ 2010 using Lazy Foo's Tutorial

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

Hi

I'm trying to set up SDL for Visual C++ 2010. I am using Lazy Foo's tutorial found here:
http://lazyfoo.net/S...son01/index.php

The test program is as follows:
#include "SDL.h"

int main( int argc, char* args[] )
{
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );

//Quit SDL
SDL_Quit();

return 0;
}

When I try to build it I get the following message:
1>------ Build started: Project: SDL_tutorial, Configuration: Debug Win32 ------
1>main.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function _SDL_main
1>main.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function _SDL_main
1>MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>c:\users\twild\documents\visual studio 2010\Projects\SDL_tutorial\Debug\SDL_tutorial.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have gone through the process from scratch twice. Can anyone give me any cles where I'm going wrong?

Thanks

Tom

Share this post


Link to post
Share on other sites
Advertisement
Hey tpwild,

The only thing i can think of is that you haven't copied the SDL.dll file to your exe path so it cant find the dll for the header, or possibly one of the dirtectories/dependancies wasn't created correctly.

Check these and see if it works

FYI DEV C++ is better as a compiler IMO i used to use VC++ 2010 but moved to DEV C++ which ios easier to setup as well

Hope this is a tiny bit helpful


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
eratenphi

Share this post


Link to post
Share on other sites
Probably you did something wrong while installing the libraries. Make sure you're pointing it to the correct version folders in the include directories and and library directories. Also make sure your linker has both SDLmain.lib and SDL.lib.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!