I try to program DirectX in Visual C++ 2008. I need at least a win32 working window.
I have a BIG problem compiling win32.

First, I created a win32 project (a simple Win32 Project - not empty). I don’t modify any code compile when compiler says: Cannot find windows.h. So I installed Platform SDK for Windows (PlatformSDK_Svr2003SP1). Same problem. I tried "Register PSDK Directories with Visual Studio". Same problem. PSDK entries are not present in VS2008->Tools->Options->Projects and Solutions->VC++ DIrectories so I MANUALY set up path for Bin, Include, Lib in VC++ Directories. As a result, it included windows.h but some other files could be opened so I added other PSDK subdirectories path in VC++ Directories until all files were found. I read both PSDK and C++ help file (about PSDK) and I put those paths BEFORE Visual C++ Installation paths as those help file were telling me to do.

NOW THE BIG PROBLEM:
A lot of LNK compilation errors:

Error 10 error LNK2001: unresolved external symbol __RTC_InitBase b.obj b
Error 9 error LNK2001: unresolved external symbol __RTC_Shutdown b.obj b
Error 26 error LNK2001: unresolved external symbol _wWinMainCRTStartup b b
Error 24 error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function "long __stdcall
WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) b.obj b
Error 7 error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function _wWinMain@16 b.obj
b
Error 23 error LNK2019: unresolved external symbol ___security_cookie referenced in function "long __stdcall
WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) b.obj b
Error 19 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) b.obj b
Error 16 error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "int __cdecl
InitInstance(struct HINSTANCE__ *,int)" (?InitInstance@@YAHPAUHINSTANCE__@@H@Z) b.obj b
Error 20 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) b.obj b
Error 21 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) b.obj b
Error 22 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) b.obj b
Error 1 error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _wWinMain@16 b.obj
b
Error 25 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) b.obj b
Error 18 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) b.obj b
Error 4 error LNK2019: unresolved external symbol __imp__GetMessageW@16 referenced in function _wWinMain@16 b.obj
b
Error 5 error LNK2019: unresolved external symbol __imp__LoadAcceleratorsW@8 referenced in function _wWinMain@16
b.obj b
Error 12 error LNK2019: unresolved external symbol __imp__LoadCursorW@8 referenced in function "unsigned short __cdecl
MyRegisterClass(struct HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) b.obj b
Error 13 error LNK2019: unresolved external symbol __imp__LoadIconW@8 referenced in function "unsigned short __cdecl
MyRegisterClass(struct HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) b.obj b
Error 6 error LNK2019: unresolved external symbol __imp__LoadStringW@16 referenced in function _wWinMain@16 b.obj
b
Error 17 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) b.obj b
Error 11 error LNK2019: unresolved external symbol __imp__RegisterClassExW@4 referenced in function "unsigned short
__cdecl MyRegisterClass(struct HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) b.obj b
Error 15 error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "int __cdecl
InitInstance(struct HINSTANCE__ *,int)" (?InitInstance@@YAHPAUHINSTANCE__@@H@Z) b.obj b
Error 3 error LNK2019: unresolved external symbol __imp__TranslateAcceleratorW@12 referenced in function _wWinMain@16
b.obj b
Error 2 error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _wWinMain@16 b.obj
b
Error 14 error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function "int __cdecl
InitInstance(struct HINSTANCE__ *,int)" (?InitInstance@@YAHPAUHINSTANCE__@@H@Z) b.obj b
Error 8 error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function _wWinMain@16 b.obj b
Error 27 fatal error LNK1120: 26 unresolved externals C:\Documents and Settings\Claudiu.CLAU\My Documents\Visual
Studio 2008\Projects\b\Debug\b.exe b


I tried a lot (days). I am desperate. Please, has anyone a perfect recipe for compiling win32 applications on Visual C++ 2008 using Platform SDK? Or some other way to program DirectX in Visual C++ (Win32)? Because I don’t know what to do. I can’t program any win32 native application (I also tried with VS2005: exactly the same problems).

I’m sure there is someone on this forum who programmed DirectX in Visual C++ who can tell me what to do. Hope I was clear about my problem. Thanks and I will appreciate every help.

Which edition of 2008 are you using (Express, Pro, etc) ? I have the Express version, downloaded the SDK Aug 2008, set up the directory paths, compiled and linked a sample program, and all went without a problem.

Before trying to write your own problem compile one of the samples to make sure your compiler's directories are set up correctly.

OK I HAD 2008 PE but i installed c++ 2005 express, set up the paths and all right now. Thanks for reply. I think it was my VS 2008 PE that was not integrating well PSDK. Thread solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.