d3dx12.h gives a bunch of errors - c++

I'm trying to learn DirectX 12 and i found out these tutorials on github. I downloaded everything and i tried to run the HelloWindow project. I linked the d3d12.lib in Debug->Options->Linker->Input. Unfortunately, it gives me a bunch of errors from d3dx12.h. For most of them, Intellisense says to include d3d12.h even if i already did it. For example, D3D12_RESOURCE_DESC1 is undefined and all his attributes too etc. Did i missed something if yes pls help me.

You are using the 'latest' copy of D3DX12.H which requires you use the 'latest' version of the Windows 10 SDK (19041). If D3D12_RESOURCE_DESC1 is undefined, you are using an older Windows 10 SDK.
Note that there are three different options for fixing this mismatch:
Install the latest Windows 10 SDK (19041). For VS 2019, this is done by running Visual Studio Installer and selecting the new Windows 10 SDK as a component. For VS 2017, you need to run the standalone installer. VS 2015 and earlier are not supported.
Use a version of the D3DX12.H utility header that supports older SDKs. I maintain a version of the 'latest' D3DX12.H header that contains a bunch of preprocessor conditionals so that it will support Windows 10 SDK (14393) or later. That happens to be last version of the Windows 10 SDK to support VS 2015. Obtain it from GitHub: directx-vs-templates.
Use GitHub DirectX-Headers: A new option is to get the latest headers including D3DX12.H as a set from GitHub. You still need a Windows 10 SDK for the link libraries.
See this blog post for details on why D3DX12.H is not part of the Windows 10 SDK.
The samples on DirectX-Graphics-Samples in the main/master branch assume you are using the latest Windows 10 SDK (19041).
As you are new to DirectX 12, you may want to take a look at DirectX Tool Kit for DX12 as a more gentle introduction to the latest version of the API.

Related

DirectX SDK folder missing folders

My application requires Microsoft DirectX June (2010)/lib/x86 however the only things that appears when opening the folder are DirectX Utility folders.
My theory is that the download must have been updated or something because when I downloaded Detours again the files were different.
Anyone know how to get the lib file?
The legacy DirectX SDK is available from download from the Microsoft Downloads site. The self-extracting EXE itself is now SHA-256 signed, but the content is unchanged from the June 2010 release.
http://go.microsoft.com/fwlink/?LinkId=226640
The legacy DirectSetup REDIST image is available here:
http://go.microsoft.com/fwlink/p/?LinkId=159853
http://go.microsoft.com/fwlink/?LinkID=194352
The self-extracting EXE, DSETUP EXEs/DLLs, and CABS are now SHA-256 signed, but the content is unchanged from the April 2011 refresh.
Keep in mind there are numerous known issues with these old bits. In particular, your original report sounds like you may have hit this issue:
https://walbourn.github.io/known-issue-directx-sdk-june-2010-setup-and-the-s1023-error/
https://learn.microsoft.com/en-US/troubleshoot/windows/win32/s1023-error-when-you-install-directx-sdk
Finally, if you are trying to use the legacy DirectX SDK with VS 2012 or later, the integration instructions are different. See https://learn.microsoft.com/en-us/windows/win32/directx-sdk--august-2009
Note that you really shouldn't need to use the legacy DirectX SDK at all.
The Windows SDK already includes the include headers and link libraries for d3d9.lib, d3d10.lib, d3d11.lib, dxgi.lib, dxguid.lib, etc. See https://walbourn.github.io/directx-sdks-of-a-certain-age/
If you need d3dx9, d3dx10, or d3dx11, you should use this NuGet instead which provides the headers, link libraries, and a simple side-by-side REDIST for those DLLs. They are also SHA-256 signed. See https://walbourn.github.io/legacy-d3dx-on-nuget/
If you need XAudio2 for Windows 7, then use this NuGet instead. See https://aka.ms/xaudio2redist
If you need dxerr.lib, build it yourself. See https://walbourn.github.io/wheres-dxerr-lib/
If you use the legacy Managed DirectX 1.1 assemblies, use SharpDX or SlimDX instead. https://walbourn.github.io/directx-and-net/
The only scenarios where you still have to use the legacy DirectX SDK are (a) to target Windows XP or (b) to use XACT.

Cannot locate ECManGen

I am wanting to write unmanaged C++ code that reads from and writes to the event log. I am working with VS2017 and Windows 10. Everything I have read states that there is a utility ECManGen that is used to create the manifest file that is then run through the message compiler (mc). I have the latest Windows 10 SDK installed. According to what I have read, the executable is in the Bin directory under the SDK. I have scanned my entire drive and have not been able to find the utility. Has the utility been deprecated for something else? Is there somewhere I can obtain the utility? It does not seem to be available for download from Microsoft as a component.
ecmangen was removed from the Windows 10 SDK starting with version 10.0.16299.15. If you install an older version of the SDK (side-by-side installation is supported, so you can keep the newer versions as well), it will be available again.

When was support for AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM added to WASAPI?

Does anyone know when support for the AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM stream flag was added to WASAPI? MSDN mentions this flag briefly, but doesn't go into much detail regarding its use and which versions of Windows support this.
I'm using the Platform SDK that comes with Visual Studio 2015 and AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM isn't even defined.
Download and install the separate Windows 10 SDK, even though most of the components are installed with VS2015:
https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
I had the same problem as you, and installing the latest Windows 10 SDK solved it for me. (Version 10.0.14393.795 at the time of writing.)

DirectX 11.2 development on Windows 7

The dynamic HLSL shader linking feature is (perhaps intentionally) only available in DirectX 11.2 on Windows 8.1+ and I found this out a little late in the game. I'm not able to upgrade my dev box at this time but in the near future I may have access to a separate machine that does have Win8.1.
Is there a way I can compile (but not run) my project with DirectX 11.2 on my Windows 7 machine so I can get access to this feature?
If that is the only 11.2 feature you use you can actually both build and run it on Windows 7, since you are allowed to redistribute d3dcompiler_47.dll (which implements the linking entrypoints) with your application. Just install the 8.1 SDK on your Win7 machine, and you should end up with all the necessary files to build and run: d3dcompiler.lib, d3dcompiler.h, and d3dcompiler_47.dll. Note you can find the redistributable version of the dll under Windows Kits\8.1\Redist\D3D.
If you don't want to install the full SDK on your dev machine, you can install it somewhere else and just manually copy over the header and lib. In general it's a bad idea to mix and match SDK components but the HLSL compiler shouldn't have any cross-dependencies that would cause problems.

redefinition of typedef errors in unofficial opengl sdk

using the arcsynthesis opengl tutorial and I'm trying to build the unofficial sdk that the examples use, per the instructions here: http://glsdk.sourceforge.net/docs/html/pg_build.html#page_build_libs . (I'm using code::blocks and the gnu gcc compiler, and 0.4.0 of the unofficial sdk) It's not working, I get this error:
C:\libs\c\glsdk_0.4.0\glload\source\wgll_ext_base.h|29|error: redefinition of typedef 'GLenum'|
C:\libs\c\glsdk_0.4.0\glload\source\gll_gl_ext_base.h|27|note: previous declaration of 'GLenum' was here|
repeated several times for other sybmols, including GLBoolean, GLBitField, etc. since I'm pretty sure I'm not supposed to fix this by actually modifying the sdk I'm assuming it's a build/linker muckup on my part, but I'm only using the workspace that premake4 generated, not rolling my own or anything.
arcsynthesis opengl tutorial and I'm trying to build the unofficial sdk that the examples use, per the instructions here: http://glsdk.sourceforge.net/docs/html/pg_build.html#page_build_libs .
The Tutorial distribution comes with the SDK; it's in the folder called glsdk. You aren't supposed to download the SDK from the SDK site. The Tutorial build instruction explain how to build it.
Also, the 0.4.0 version is somewhat old; there was a build problem with Code::Blocks (and probably other builds). The most recent release is 0.4.2, which should work.
Follow the premake instructions for vs2010
In Code::Blocks, go to file-->import project-->Microsoft Visual Studio Solution
Import openglsdk.sln from the directory where you placed the sdk files
Now the sdk will be available as a workspace in Code::Blocks. As of this post, the Unofficial OpenGL SDK is version 0.50. I answered this with step by step directions because I couldn't find any for Code::Blocks, and some people just beginning to learn OpenGL may need a little guidance.