0

Okay.. This may be a stupid question. I just followed a tutorial on how to make a game engine. I have been fighting my way through several errors, and i finally think i'm getting into the last errors. So here is my errors:

Error 1 error LNK2019: unresolved external symbol _imp_MessageBoxA@16 referenced in function __catch$_wWinMain@16$0

Error 2 error LNK2019: unresolved external symbol "public: __thiscall Engine::Engine(void)" (??0Engine@@QAE@XZ) referenced in function _wWinMain@16

Error 3 error LNK2019: unresolved external symbol "public: void __thiscall Engine::Go(void)" (?Go@Engine@@QAEXXZ) referenced in function _wWinMain@16

Error 4 error LNK1120: 3 unresolved externals

Code:

#include <Windows.h>
#include "Engine.h"

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
{
    Engine* engine = new Engine();

    try
    {
        engine->Go();
    }
    catch(char* e)
    {
        MessageBoxA(NULL, e, "Exception Occured", MB_OK | MB_ICONERROR);
    }
}

So i kinda guessed that it is the wWinMain thing, i have made.But what the problem is, is unclear to me.

Thanks in advance.

mads232
  • 339
  • 1
  • 5
  • 14

1 Answers1

3
error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function __catch$_wWinMain@16$0

This error indicates you need to link your project against user32.lib.

error LNK2019: unresolved external symbol "public: __thiscall Engine::Engine(void)" (??0Engine@@QAE@XZ) referenced in function _wWinMain@16
error LNK2019: unresolved external symbol "public: void __thiscall Engine::Go(void)" (?Go@Engine@@QAEXXZ) referenced in function _wWinMain@16

These errors indicate you need to compile and link Engine.cpp into your project.

Oktalist
  • 14,336
  • 3
  • 43
  • 63