Visual C++ Install Ok but cannot compile example

Hi All,

I have downloaded and installed the above and the SDK.

I believe I have followed all of the instructions but when I go to build a blank app as per the recommended test I get the following:-

 

------ Build started: Project: test1, Configuration: Debug Win32 ------

Compiling...

stdafx.cpp

Compiling...

test1.cpp

Compiling resources...

Compiling manifest to resources...

Linking...

test1.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _wWinMain@16

test1.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _wWinMain@16

test1.obj : error LNK2019: unresolved external symbol __imp__TranslateAcceleratorW@12 referenced in function _wWinMain@16

test1.obj : error LNK2019: unresolved external symbol __imp__GetMessageW@16 referenced in function _wWinMain@16

test1.obj : error LNK2019: unresolved external symbol __imp__LoadAcceleratorsW@8 referenced in function _wWinMain@16

test1.obj : error LNK2019: unresolved external symbol __imp__LoadStringW@16 referenced in function _wWinMain@16

test1.obj : error LNK2019: unresolved external symbol __imp__RegisterClassExW@4 referenced in function "unsigned short __cdecl MyRegisterClass(struct HINSTANCE__ *)" ( MyRegisterClass@@YAGPAUHINSTANCE__@@@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__LoadCursorW@8 referenced in function "unsigned short __cdecl MyRegisterClass(struct HINSTANCE__ *)" ( MyRegisterClass@@YAGPAUHINSTANCE__@@@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__LoadIconW@8 referenced in function "unsigned short __cdecl MyRegisterClass(struct HINSTANCE__ *)" ( MyRegisterClass@@YAGPAUHINSTANCE__@@@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)" ( InitInstance@@YAHPAUHINSTANCE__@@H@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)" ( InitInstance@@YAHPAUHINSTANCE__@@H@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)" ( InitInstance@@YAHPAUHINSTANCE__@@H@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" ( WndProc@@YGJPAUHWND__@@IIJ@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__EndPaint@8 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" ( WndProc@@YGJPAUHWND__@@IIJ@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__BeginPaint@8 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" ( WndProc@@YGJPAUHWND__@@IIJ@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" ( WndProc@@YGJPAUHWND__@@IIJ@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" ( WndProc@@YGJPAUHWND__@@IIJ@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__DialogBoxParamW@20 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" ( WndProc@@YGJPAUHWND__@@IIJ@Z)

test1.obj : error LNK2019: unresolved external symbol __imp__EndDialog@8 referenced in function "int __stdcall About(struct HWND__ *,unsigned int,unsigned int,long)" ( About@@YGHPAUHWND__@@IIJ@Z)

C:\My Documents\Visual Studio 2005\Projects\test1\Debug\test1.exe : fatal error LNK1120: 19 unresolved externals

Build log was saved at file://c:\My Documents\Visual Studio 2005\Projects\test1\test1\Debug\BuildLog.htm

 

What have I done wrong

ps I tried to search for C++, Install on the forum, you need to uncode the form input I this gets changed to C,  Install which is not very useful.



Answer this question

Visual C++ Install Ok but cannot compile example

  • Vitalijus

    I have the exact same error as the poster, but do not understand the solution. How do I include this 'User32.lib' Thank you.

  • theinspector

    Sorry I am replying, but I couldn't figure out how to 'edit' (since I just posted anyway it shouldn't bump the thread). The solution was that I was changing 'CoreWin' instead of 'CoreWin_Express'.

  • ryuga99

    You have not include User32.lib...
  • Visual C++ Install Ok but cannot compile example