|
|
wc.lpszClassName = ClassName();
when I use #define UNICODE, I get a 'macro redefinition' warning when I build in VS and when I compile on the command line I get a string of LNK2019 ERRORS unresolved external symbol, so I took it out. |
C:\Test>cl /nologo /W4 /EHsc /MDd -DDEBUG -D_DEBUG kernel32.lib user32.lib gdi32.lib /Fetest.exe main.cpp main.cpp main.cpp(119) : warning C4100: 'lCmdLine' : unreferenced formal parameter main.cpp(119) : warning C4100: 'hPrevInstance' : unreferenced formal parameter main.cpp(119) : warning C4100: 'hInstance' : unreferenced formal parameter c:\Test\main.cpp(117) : warning C4715: 'MainWindow::HandleMessage' : not all control paths return a value |
int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, PWSTR /*lCmdLine*/, int /*nCmdShow*/)
|
|
c:\Users\Matt\Documents\Visual Studio 2012\Projects\Win32Project3\Win32Project3> cl win32project3.cpp Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x86 Copyright (C) Microsoft Corporation. All rights reserved. win32project3.cpp C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xlocale(336) : wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. S pecify /EHsc win32project3.cpp(90) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'const wchar_t [13]' to 'LPCSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C- style cast or function-style cast win32project3.cpp(110) : error C2664: 'TextOutA' : cannot convert parameter 4 fr om 'const wchar_t *' to 'LPCSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C- style cast or function-style cast c:\Users\Matt\Documents\Visual Studio 2012\Projects\Win32Project3\Win32Project3> |
c:\Users\Matt\Documents\Visual Studio 2012\Projects\Win32Project3\Win32Project3> cl win32project3.cpp /DUNICODE Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x86 Copyright (C) Microsoft Corporation. All rights reserved. win32project3.cpp C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xlocale(336) : wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. S pecify /EHsc c:\users\matt\documents\visual studio 2012\projects\win32project3\win32project3\ win32project3.cpp(118) : warning C4715: 'MainWindow::HandleMessage' : not all co ntrol paths return a value Microsoft (R) Incremental Linker Version 11.00.50727.1 Copyright (C) Microsoft Corporation. All rights reserved. /out:win32project3.exe win32project3.obj win32project3.obj : error LNK2019: unresolved external symbol __imp__TextOutW@20 referenced in function "public: virtual long __thiscall MainWindow::HandleMessa ge(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__GetMessageW @16 referenced in function _wWinMain@16 win32project3.obj : error LNK2019: unresolved external symbol __imp__TranslateMe ssage@4 referenced in function _wWinMain@16 win32project3.obj : error LNK2019: unresolved external symbol __imp__DispatchMes sageW@4 referenced in function _wWinMain@16 win32project3.obj : error LNK2019: unresolved external symbol __imp__DefWindowPr ocW@16 referenced in function "public: virtual long __thiscall MainWindow::Handl eMessage(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__PostQuitMes sage@4 referenced in function "public: virtual long __thiscall MainWindow::Handl eMessage(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__RegisterCla ssW@4 referenced in function "public: int __thiscall BaseWindow<class MainWindow >::Create(wchar_t const *,unsigned long,unsigned long,int,int,int,int,struct HWN D__ *,struct HMENU__ *)" (?Create@?$BaseWindow@VMainWindow@@@@QAEHPB_WKKHHHHPAUH WND__@@PAUHMENU__@@@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__CreateWindo wExW@48 referenced in function "public: int __thiscall BaseWindow<class MainWind ow>::Create(wchar_t const *,unsigned long,unsigned long,int,int,int,int,struct H WND__ *,struct HMENU__ *)" (?Create@?$BaseWindow@VMainWindow@@@@QAEHPB_WKKHHHHPA UHWND__@@PAUHMENU__@@@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__DestroyWind ow@4 referenced in function "public: virtual long __thiscall MainWindow::HandleM essage(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@ 8 referenced in function _wWinMain@16 win32project3.obj : error LNK2019: unresolved external symbol __imp__BeginPaint@ 8 referenced in function "public: virtual long __thiscall MainWindow::HandleMess age(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__EndPaint@8 referenced in function "public: virtual long __thiscall MainWindow::HandleMessag e(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__MessageBoxW @16 referenced in function "public: virtual long __thiscall MainWindow::HandleMe ssage(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__FillRect@12 referenced in function "public: virtual long __thiscall MainWindow::HandleMessa ge(unsigned int,unsigned int,long)" (?HandleMessage@MainWindow@@UAEJIIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__GetWindowLo ngW@8 referenced in function "public: static long __stdcall BaseWindow<class Mai nWindow>::WindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowPr oc@?$BaseWindow@VMainWindow@@@@SGJPAUHWND__@@IIJ@Z) win32project3.obj : error LNK2019: unresolved external symbol __imp__SetWindowLo ngW@12 referenced in function "public: static long __stdcall BaseWindow<class Ma inWindow>::WindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowP roc@?$BaseWindow@VMainWindow@@@@SGJPAUHWND__@@IIJ@Z) win32project3.exe : fatal error LNK1120: 16 unresolved externals |
CL win32project3.cpp Gdi32.lib
and try again, looking up .lib files as it complains about them.CL win32project3.cpp Gdi32.lib kernel32.lib user32.lib
because that probably hits 'em all.
|
|
EDIT: But immediately try CL win32project3.cpp Gdi32.lib kernel32.lib user32.lib because that probably hits 'em all. |