Here are the error codes and here [VectorEngine.h]
#ifndef _CAPP_H_
#define _CAPP_H_
#include <SDL.h>
class VectorEngine
{
private:
bool running;
SDL_Window* Surf_Display;
public:
VectorEngine();
void onExecute();
bool OnInit();
void OnEvent(SDL_Event* Event);
void OnTick();
void OnRender();
void OnCLeanup();
};
#endif
[Main.cpp]
#include"VectorEngine.h"
#include <Windows.h>
const int TICKS_PER_SECOND = 25;
const int SKIP_TICKS = 1000 / TICKS_PER_SECOND;
const int MAX_RENDERSKIPS = 5;
VectorEngine::VectorEngine()
{
Surf_Display = NULL;
running = true;
OnInit();
onExecute();
}
void VectorEngine::onExecute()
{
SDL_Event Event;
DWORD next_game_tick = GetTickCount();
while (running)
{
int skippedRenders = 0;
while (GetTickCount()> next_game_tick && skippedRenders < MAX_RENDERSKIPS)
{
OnTick();
next_game_tick += SKIP_TICKS;
skippedRenders++;
}
OnRender();
}
}
int main (int argc, char* argv[])
{
VectorEngine *vecEngine = new VectorEngine();
return 0;
}
[Oninit.cpp]
#include "VectorEngine.h"
bool VectorEngine::OnInit()
{
SDL_Init(SDL_INIT_EVERYTHING);
Surf_Display = SDL_CreateWindow("My Game Window",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
640, 480,
SDL_WINDOW_SHOWN| SDL_WINDOW_OPENGL);
return true;
}
[OnCLeanup.cpp]
#include"VectorEngine.h"
void VectorEngine::OnCLeanup()
{
SDL_Quit();
}
This is the link to all the code an [here]().
This is the link to all the linker settings:
Error 5 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Users\XSoloDoloX\Desktop\VecEng\GameForReal\GameForReal\MSVCRTD.lib(crtexew.obj) GameForReal
Error 2 error LNK2019: unresolved external symbol _SDL_Quit referenced in function "public: void __thiscall VectorEngine::OnCLeanup(void)" (?OnCLeanup@VectorEngine@@QAEXXZ) C:\Users\XSoloDoloX\Desktop\VecEng\GameForReal\GameForReal\OnCleanup.obj GameForReal
Error 4 error LNK2019: unresolved external symbol _SDL_Init referenced in function "public: bool __thiscall VectorEngine::OnInit(void)" (?OnInit@VectorEngine@@QAE_NXZ) C:\Users\XSoloDoloX\Desktop\VecEng\GameForReal\GameForReal\OnInit.obj GameForReal
Error 3 error LNK2019: unresolved external symbol _SDL_CreateWindow referenced in function "public: bool __thiscall VectorEngine::OnInit(void)" (?OnInit@VectorEngine@@QAE_NXZ) C:\Users\XSoloDoloX\Desktop\VecEng\GameForReal\GameForReal\OnInit.obj GameForReal
Error 6 error LNK1120: 4 unresolved externals C:\Users\XSoloDoloX\Desktop\VecEng\GameForReal\Debug\GameForReal.exe 1 1 GameForReal