• Advertisement
Sign in to follow this  

DX11 D3DX in Visual Studio 2010 on Windows 7...

This topic is 1516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why use D3DX?

I understand that D3DX is deprecated and replaced by DirectXMath in the Windows 8 SDK.  However DirectXMath is not included in the Windows 7 SDK, and neither is D3DX...which means that there seems to be no "proper way" to access these basic utility functions.  I have heard that it may work to use the Windows 8 SDK for development on Windows 7, however, that doesn't sound entirely reliable to me...and I'm not interested in developing Windows 8 apps at this time anyway.  I would like to utilize some of my older code that is written using D3DX for this project and so I prefer to stick with that for now.  Therefore, I am trying to use the last DirectX SDK frome June 2010.

What's the problem?

After installing the DirectX SDK, and added the new include and lib paths under the Win32.User properties page in Visual Studio (as explained in the answer here ), and add the following includes:

 

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

 

#pragma comment (lib, "d3d11.lib")
#pragma comment (lib, "d3dx11.lib")
#pragma comment (lib, "d3dx10.lib")

 

...and now, although I can use certain D3DX functions like D3DXCOLOR,  I get unresolved external symbol errors for certain functions like D3DXCompileFromFile and D3D11CreateDeviceAndSwapChain. 

I think the problem is that d3dx11.h exists in two places:
 

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include
 

In other words, the D3DX headers conflicts with the headers already present in the built in windows SDK, and I cannot even remove those built in include paths or give my include path priority over them (at least I don't know how).

How can I resolve this issue?

Edited by yahastu

Share this post


Link to post
Share on other sites
Advertisement

You can probably resolve this if you include the absolute path to both the D3DX header and library files (as a project's "Additional Dependencies").

 

#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx11.h>

Share this post


Link to post
Share on other sites

You can probably resolve this if you include the absolute path to both the D3DX header and library files (as a project's "Additional Dependencies").

 

#include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3dx11.h>

I tried adding the paths to "Configuration Properties => C/C++ => General => Additional Include directories" and "Configuration Properties => Linker => General => Additional Library directories" (in addition to the Microsoft.Cpp.Win32.user properties), and also changed the include files to specify the full-path location to the D3DX headers as in your example, but there is no change.

Perhaps the problem lies with the fact that I cannot use an absolute path to specify the library name -- eg, in "#pragma comment (lib, "d3d11.lib")" and so, it may continue to look for the library in the Windows 7 sdk first....

It seems like this would be a problem for all Windows 7 users that attempt to use DirectX...there must be a common resolution

Share this post


Link to post
Share on other sites

I have heard that it may work to use the Windows 8 SDK for development on Windows 7, however, that doesn't sound entirely reliable to me...and I'm not interested in developing Windows 8 apps at this time anyway. 

It's fine, I've done it myself. The Windows SDK is set up such that you can specify the minimum supported Windows version at compile-time using macro definitions. If you specify that Windows 7 is your minimum version, then any unsupported functionality will be unavailable and you'll get a compilation error if you try to use it.

However you should still be able to get D3DX to work fine. You just need to make sure that the DX SDK directory is listed before the Windows SDK directory in your VC++ include directories. You can do this in the project settings by putting the DX SDK directory before the "inherited from project defaults" entry.

Share this post


Link to post
Share on other sites

Got it working.  The trick was modifying the list of semicolon delimitted items manually rather than via clicking on it and using the built-in path list editor.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Karol Plewa
      Hi, 
       
      I am working on a project where I'm trying to use Forward Plus Rendering on point lights. I have a simple reflective scene with many point lights moving around it. I am using effects file (.fx) to keep my shaders in one place. I am having a problem with Compute Shader code. I cannot get it to work properly and calculate the tiles and lighting properly. 
       
      Is there anyone that is wishing to help me set up my compute shader?
      Thank you in advance for any replies and interest!
    • By turanszkij
      Hi, right now building my engine in visual studio involves a shader compiling step to build hlsl 5.0 shaders. I have a separate project which only includes shader sources and the compiler is the visual studio integrated fxc compiler. I like this method because on any PC that has visual studio installed, I can just download the solution from GitHub and everything just builds without additional dependencies and using the latest version of the compiler. I also like it because the shaders are included in the solution explorer and easy to browse, and double-click to open (opening files can be really a pain in the ass in visual studio run in admin mode). Also it's nice that VS displays the build output/errors in the output window.
      But now I have the HLSL 6 compiler and want to build hlsl 6 shaders as well (and as I understand I can also compile vulkan compatible shaders with it later). Any idea how to do this nicely? I want only a single project containing shader sources, like it is now, but build them for different targets. I guess adding different building projects would be the way to go that reference the shader source project? But how would they differentiate from shader type of the sources (eg. pixel shader, compute shader,etc.)? Now the shader building project contains for each shader the shader type, how can other building projects reference that?
      Anyone with some experience in this?
    • By osiris_dev
      Hello!
      Have a problem with reflection shader for D3D11:
      1>engine_render_d3d11_system.obj : error LNK2001: unresolved external symbol IID_ID3D11ShaderReflection
      I tried to add this:
      #include <D3D11Shader.h>
      #include <D3Dcompiler.h>
      #include <D3DCompiler.inl>
      #pragma comment(lib, "D3DCompiler.lib")
      //#pragma comment(lib, "D3DCompiler_47.lib")
      As MSDN tells me but still no fortune. I think lot of people did that already, what I missing?
      I also find this article http://mattfife.com/?p=470
      where recommend to use SDK headers and libs before Wind SDK, but I am not using DirectX SDK for this project at all, should I?
    • By trojanfoe
      Hi there, this is my first post in what looks to be a very interesting forum.
      I am using DirectXTK to put together my 2D game engine but would like to use the GPU depth buffer in order to avoid sorting back-to-front on the CPU and I think I also want to use GPU instancing, so can I do that with SpriteBatch or am I looking at implementing my own sprite rendering?
      Thanks in advance!
    • By Matt_Aufderheide
      I am trying to draw a screen-aligned quad with arbitrary sizes.
       
      currently I just send 4 vertices to the vertex shader like so:
      pDevCon->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
      pDevCon->Draw(4, 0);
       
      then in the vertex shader I am doing this:
      float4 main(uint vI : SV_VERTEXID) : SV_POSITION
      {
       float2 texcoord = float2(vI & 1, vI >> 1);
      return float4((texcoord.x - 0.5f) * 2, -(texcoord.y - 0.5f) * 2, 0, 1);
      }
      that gets me a screen-sized quad...ok .. what's the correct way to get arbitrary sizes?...I have messed around with various numbers, but I think I don't quite get something in these relationships.
      one thing I tried is: 
       
      float4 quad = float4((texcoord.x - (xpos/screensizex)) * (width/screensizex), -(texcoord.y - (ypos/screensizey)) * (height/screensizey), 0, 1);
       
      .. where xpos and ypos is number of pixels from upper right corner..width and height is the desired size of the quad in pixels
      this gets me somewhat close, but not right.. a bit too small..so I'm missing something ..any ideas?
       
      .
  • Advertisement