Hello everybody,
I have some trouble with running SDL. I already made a working zombie game for school and i wanted to make a new game on my own. The problem is that i can't even find a way to get SDL to work.
here is my code ..
//stdafx
Code:
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
#include <Windows.h>
#include <time.h>
#include "SDL\sdl.h"
//main
Code:
// SDL_TEST.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "stdafx.h"
const int screen_w = 640;
const int screen_h = 480;
const int screen_bpp = 32;
SDL_Surface * screen = NULL;
bool init()
{
if (SDL_INIT_EVERYTHING == -1)
return false;
screen = SDL_SetVideoMode(screen_w, screen_h, screen_bpp, SDL_SWSURFACE);
if (screen = NULL)
return false;
SDL_WM_SetCaption("TEST SDL", NULL);
return true;
}
int _tmain(int argc, _TCHAR* argv[])
{
bool End = false;
if (init() == true)
{
while (End == false)
{
End = true;
}
}
return 0;
}
Error:
Code:
1>------ Build started: Project: SDL_TEST, Configuration: Debug Win32 ------
1> SDL_TEST.cpp
1>SDL_TEST.obj : error LNK2019: unresolved external symbol _SDL_WM_SetCaption referenced in function "bool __cdecl init(void)" (?init@@YA_NXZ)
1>SDL_TEST.obj : error LNK2019: unresolved external symbol _SDL_SetVideoMode referenced in function "bool __cdecl init(void)" (?init@@YA_NXZ)
1>c:\users\pogg\documents\visual studio 2010\Projects\SDL_TEST\Debug\SDL_TEST.exe : fatal error LNK1120: 2 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thank you!
Pierre-Olivier Girard
NOTE: I am fairly new to computer programming and my English is kinda bad.