DirectX in Windows 8 SDK
Asked Answered
S

2

4

Summary: Should directX include files be removed from applications targeting Windows 8?

Details:

I'm new to developing in Windows and I'm trying to get the NVIDIA SDK to compile on Windows 8 with Visual Studio 2012 (if possible). When compiling I've gotten an error message: Cannot open include file: 'd3dx9.h': No such file or directory.

I've read the Where is the DirectX SDK? article, but I'm confused about what it is saying to do.

Assuming that I don't care about Windows 7 and only want to test desktop applications on Windows 8 (ignoring Metro for now), do I need to keep the includes such as #include <d3dx9.h> and #include <d3dx11.h> that are in the NVIDIA SDK app, or should I remove these includes? If I do keep them what do I need to install so that the files can be found.

Subdivide answered 18/6, 2013 at 22:10 Comment(0)
C
6

These samples was intended to be built with DirectX SDK and Windows SDK (pre-Win8).

However, Microsoft does not recommend to use D3DX* stuff anymore (among others). They deprecated standalone DirectX SDK, stripped d3dx*.h and d3dx*.lib files and merged remains to Windows 8 SDK.

So, to build samples you must use:

  • For DirectX headers/libs: old standalone DirectX SDK (Jun 2010)
  • For other Windows headers/libs: Windows 7 SDK -OR- Windows 8 SDK in "XP mode" (Project Properties -> General -> Platform Toolset -> v110_xp )

To prevent mixing headers and libs, it is better to set exact paths to them in "VC++ Directories".

For your own new projects it is better not to use DirectX SDK, but use DirectX headers from Windows 8 SDK.

Christa answered 19/6, 2013 at 6:42 Comment(0)
L
2

Make sure that you get the latest DirectX SDK. It has the header files.

Try to follow this step, hope this ll solve ur problem

Link the Include and Library directories

  1. Open Visual Studio 2012
  2. Select C++
  3. Select A Blank Project
  4. Go to Project Menu > Properties
  5. In the window that opens up, on the left, Click on Configuration Properties > VC++ Directories
  6. Click on Include Directories on the right.
  7. Click on the Down Arrow and click on Edit
  8. A window will pop up,Click on the Yellow folder icon on the top-right.
  9. Click on the '...' icon the right if the line. A 'Select Folder' Window Will pop up.
  10. Go the the folder where you have installed DirectX SDK. If nothing is changed, it will be in

    C:\Program Files (x86)\Microsoft DirectX SDK. 
    
  11. Get inside the Include Directory and Click on 'Select Folder'. Click Ok.
  12. Now Select 'Library Directories' and do the same Step 7 to Step 10
  13. Go inside the Lib\x86 Folder and click on 'Select Folder'.
  14. Click OK. Now all the Directories are linked. But we still need to link the header files. Add a new source file.

Type the Following code at the top of the file to include the Direct3D header files:

      #include <d3d11.h>
      #include <d3dx11.h> 

14. Well that's all. You need to do this to configure DirectX for Visual C++ 2012 Project.

You can take a look from here

d3dx11.h missing?

and

Cannot open include file "d3dx9.h"

Thanks !!!

Lydia answered 18/6, 2013 at 22:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.