beginning directx 11 game programming - The example won't run. I'm using Visual Studio 2015

Started by
27 comments, last by GameDevCoder 7 years, 5 months ago

So i tried this last night. The error can be resolved by restarting the computer apparently. But after trying again today I get the same message.

I'm thinking of uninstalling VS'15 and installing again with the options selected in the first place.

When i installed first time round VS'15 i was wary of the space I had so couldn't do a full install. I might be paying for that now ^^.

So, if anyone would like to reply I'd be most grateful. Thanks. I haven't been too active with this issue over last day or so but this evening am looking to work this out. Just want the code to run.

Also. When i went into modify last night I hadn't had any of the sdk's installed so i have 2 of the 3 installed now so that's new. The code still won't run though.


It seems your project can't locate Windows.h (it is red underlining).

Create new Win32 project, and compare paths and general settings between your DX project and win32 reference project.

i will try this now

Advertisement

no sign of windows.h in the example i'm running. Can anyone guide me at all please. Sorry. I am a bit of a noob with all this.

I'm on a Coding course that hopefully will get me into the games industry. If this forum can help me along the way i'd be very happy. Thanks for any help anyone can offer me. Ty.

IncludeDirectories.png

1. Do you have some similar "Included Directories"?

2. If so, do you have the header in one of those directories on your system?

🧙

no sign of windows.h in the example i'm running

Windows.h - is a system header.

It lives in C:\Program Files (x86)\Windows Kits\...

It should not be in example folder.

Try to search from this folder for this file.

Probably it will be in C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0 or C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0

1. Do you have some similar "Included Directories"?

On top of that, this book uses "DXSDK_10" SDK.

It is from days when DirectX was not part of Visual Studio.

So you need NOT to delete SDK-related paths from your project configuration.

If you have not installed the SDK, you need to download it and install.

Link

ill carryout what the last 2 posts have said. 1 moment please.

@Happy. Do i need to add include <windows.h> into my code do you think then? < edit - i realise now this might not make much sense, its already in some code. I meant do i need to put it in the header area somewhere?


I have Microsoft DirectX SDK (June 2010) installed in on my PC also

I found windows.h in C:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0

So i went into properties of the project. Clicked on vc++ directories. include. Here I added the directory for the windows.h. After running the issue still remains.

..... i wish i could delete this entry. made by mistake

Would anyone in this forum be able to help me get this example working if possible please. It's just a little frustrating. This book 'beginning directx 11 game programming' examples I would of thought that'd work from the start but i can't run the examples. Maybe because i'm using a different Visual Studio that they made the examples in I do not know. Just annoying how I can't run the code so I can learn directx.

Please if anyone can help me i'd be most grateful. It is just so frustrating.

The screenshot is just something i tried recently. Due to the error cannot open include file windows.h. I am trying whatever I can to try resolve this.


Can i ask. If i can find the header file in my c: . What do I then do from here? Again, I am not brilliant at coding yet so may need to be walked through possibly.

@matt. Hi, just looking at your post now. I will see. 1 moment

in that screenshot just above. After i added that include directory it popped up in the evaluated value also.

I run the code and still it won't work :( .

I will likely be on again tomorrow evening (work in the daytime). I'll continually be in touch with this thread as this is something I really need to try and resolve. As i'm trying to do something on a course I'm studying.

Ok, I decided to make my hands dirty. :)

Here is a step-by-step fix:

1. [optional]Retarget your project to existing Windows SDK:

Right button on a project in solution explorer, “Retarget SDK version”. Choose one of installed on your computer.

2. Fix Project paths: Right click on project => Properties. In dialog: Configuration properties => VC++Directories.

2.1. Set Include directories:

$(DXSDK_DIR)Include;$(VC_IncludePath);$(WindowsSDK_IncludePath);

2.2. Set library directories:

$(DXSDK_DIR)Lib\x86;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86

3. If you will have compilation error like this:

unresolved external symbol __vsnprintf referenced in function "long __stdcall StringVPrintfWorkerA(char *,unsigned int,unsigned int *,char const *,char *)" (?StringVPrintfWorkerA@@YGJPADIPAIPBD0@Z)

Add


int (WINAPIV * __vsnprintf)(char *, size_t, const char*, va_list) = _vsnprintf;

after


#include"CubeDemo.h"

You can find the project here:

https://www.dropbox.com/s/x4j3h4fjoqb16o5/3DCube.zip?dl=0

This link will be valid till 2016.12.02

This topic is closed to new replies.

Advertisement