Skip to main content
gamedev.net
🔒 Locked

error LNK2019

Started by Fixxer Jul 12, 2006 at 1:13 PM 0 replies 350+ views
Original Post
Fixxer
Fixxer
I just reinstalled windows XP on my computer, and just got VC++ 2005 Express back on it, and I am trying top compile this simple program but i get this error. ------ Build started: Project: Listing 2.2, Configuration: Debug Win32 ------ Compiling... main.cpp Linking... main.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function _WinMain@16 C:\Documents and Settings\Owner\Desktop\Programming\Windows Game Programming Lessons\Chapter Two\Listing 2.2\Debug\Listing 2.2.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at "file://c:\Documents and Settings\Owner\Desktop\Programming\Windows Game Programming Lessons\Chapter Two\Listing 2.2\Listing 2.2\Debug\BuildLog.htm" Listing 2.2 - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <windowsx.h>

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance,
				   LPSTR lpcmdline, int ncmdshow)
{
	MessageBox(NULL, "Hello World", "Hello!", MB_OK | MB_ICONEXCLAMATION);

	return 0;
}

N2O
N2O
In the linker input additional dependencies add User32.lib and Gdi32.lib and you are good to go.

Topic Locked

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

Sign in to reply to this topic.