DirectX in Windows 8 SDK - winapi

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.

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.

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
Open Visual Studio 2012
Select C++
Select A Blank Project
Go to Project Menu > Properties
In the window that opens up, on the left, Click on Configuration Properties > VC++ Directories
Click on Include Directories on the right.
Click on the Down Arrow and click on Edit
A window will pop up,Click on the Yellow folder icon on the top-right.
Click on the '...' icon the right if the line. A 'Select Folder' Window Will pop up.
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.
Get inside the Include Directory and Click on 'Select Folder'. Click Ok.
Now Select 'Library Directories' and do the same Step 7 to Step 10
Go inside the Lib\x86 Folder and click on 'Select Folder'.
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 !!!

Related

error C1083: cannot open include file: 'winsock2.h': No such file or directory

Visual Studio 2013 returns this error when I tried to build a Snare (http://www.intersectalliance.com/projects/BackLogNT/) project.
I installed the Windows SDK and I realized that I am supposed to include the SDK path into my project. Could anyone explain how to include the SDK path into a Visual Studio project?
The answer by user2644318 is quite hardcoded. An alternative is to try this:
- Open the Project properties
- Goto Configuration Properties -> General
- Set the Platform Toolset to v120_xp (Visual Studio 2013 - Windows XP)
- Recompile
Funnily enough I can mix toolsets for libraries; they link fine. Ofcourse, this only gets you XP interface capabilities.
I think answer of Ruud van Gaal is more correct.
What I did:
- install Windows SDK for Windows XP (7.1) from here
http://www.microsoft.com/en-us/download/details.aspx?id=8279
open the Project properties - Goto Configuration Properties -> General - Set the Platform Toolset to "Visual Studio 2013 - Windows XP (v120_xp)"
after this Include/Libraries paths were changed to correct folders
$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);
$(VC_LibraryPath_x86);$(WindowsSdk_71A_LibraryPath_x86);
So I did NOT change them manually.
Only targeting correct tool set and everything started to work.
In Visual Studio 2013, under Solution Explorer, right click on the project -> Properties -> Configuration Properties -> VC++ Directories, then include (WindowsSDK_IncludePath_um); in Include and Library Directories. I was able to solve this issue with this approach.
I just downloaded and installed windows SDK 8.1 for my windows 7. VS2013 looks for winsock2.h header in C:\Program Files (x86)\Windows Kits\8.1 folder. This approach works for me.
If you are encountering the same problem in Visual Studio 2019, the problem might be that you started off with a completely blank project. It literally states that there are no starting files. So instead I created a new project based on any other than "Empty Project". Now I could find winsock-files in external dependencies.
It may sound like a lazy workaround, but it will save you from the startup headache of having to tamper with include paths.

Deploying DirectX/MFC app with Visual Studio 2010 Professional

I am able to run my app through the VS2010 environment. But cannot make it working as a stand-alone exe (to run it just by double click on exe). I don't know what files are required.
In VS in Additional Dependencies I have:
d3d11.lib
d3dcompiler.lib
d3dx11d.lib
d3dx9d.lib
dxerr.lib
dxguid.lib
winmm.lib
comctl32.lib
I tried to copy these files to the same directory where my exe is:
d3d11.dll
d3dcompier_43.dll
d3dx9d_43.dll
d3dx11d_43.dll
I also tried to find some dependencies, but the dependency walker crashes with some errors. So I used dependency scanner in InstallShield 2010, it said:
d3dx11d_43.dll
Microsoft (R) C Runtime Library
Microsoft OLE 2.40 for Windows NT(TM) and Window 95(TM) Operating Systems
VC User gdiPlus RTL X86
What are the last three things? What else can I do?
// EDIT
The app has been created by using DirectX SDK June 2010, so I have installed the DX End User June http://www.microsoft.com/en-us/download/details.aspx?id=8109 .
However, the app is working throught the VS2010, but the stand-alone exe (on the same computer) doesn't work, so I think the DX End User wasn't even necessary if I had SDK (the Visual C++ Redist was installed too).
I also tried to create a setup via VS2010, it copied these files:
COMDLG32.dll
d3d11.dll
d3dx11d_43.dll
IMM32.dll
MSIMG32.dll
OLEACC.dll
oledlg.dll
but it still doesn't work (while clicking on the exe it always displays the: Program xyz has stopped working. Windows can find a solution to this problem online. Find/Close/Debug buttons.)
Maybe it is something with the MFC?
Instead of just copying those DLLs, you'll need to install the DirectX End-User Runtime (the correct version, matching your development environment) on the user's system, as well as the Microsoft Visual C++ Runtime.

DirectX SDK integration with VS 2010

I'm not sure if anyone has noticed but there seems to be a conflict with the DirectX SDK and VS2010's Windows SDK. If you look inside the folder under the directory
C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Include
You will see it contains the old headers for DirectX 11. The above directory is by default included to each VS 2010 project file and is required in order for VS 2010 to be able to compile correctly.
The same is true for .lib files for DirectX.
Now here lies the problem, to include the Directx SDK to your project in VS2010 you add the directories via the project property sheet. This automatically means you are including both the old headers and libs for DirectX as well as the new ones... :(
If you think you're building with the latest DirectX libs and header files you may very well be mistaken as the compiler could be using the unintended files.
How can I get around this problem as I can't seem to compile anything without keeping the default project settings ?
Also bare in mind I am using C++ and VS2010 Ultimate from MSDNAA.
Short answer: It probably doesn't matter.
Updated DXSDK installation won't update the system DLLs that ship with windows. It doesn't matter if you are including/linking with the DXSDK directory or the v7.0A directory. When the app runs, it loads the same DLLs either way. (Notable exception: the D3DX_xx.dll for helper functions - as those aren't OS components, they ship with the SDK and are meant for inclusion in the app setup package). The header files that ship with DXSDK should be nearly identical to what's in the v7.0a directory.
And if I'm not mistaken, include and lib directories specified in the Project Settings dialog for your app take predence BEFORE default SDK dirs. So updating your Project Settings dialog should be ok.
But if you really want to be sure... Instead of adding the DXSDK header/libs for each project, make them default search directories for all projects.
From the top-level menu for Visual Studio: Select Tools->Options.
From the left-nav menu on the Options dialog select "Project & Solutions", and "VC++ Directories" underneath that.
Then on the dropdown in the top right for "Show Directories for", select "Include Files".
Makes sure your $(DXSDK) include directory comes before the $(WindowsSdkDir) entry. If it's not already there, add it.
Repeat this for the "Library Files" option under the "Show Directories for" menu option.

OpenGL config in Visual Studio 2010

i would like to use OpenGl in Visual Studio 2010. Following Problem: "error LNK1104: Data "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" could not be oppend"
I read many Tutorials but they don´t help me :-(.
The lib data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\lib".
The header data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\Include\gl"
The dll data sets are in "C:\Windows\SysWOW64"
I Use Windows 7 Professional 64Bit.
I put "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" on Project > Properties > Linker > Input.
This is what you need to do.
Obtain GLUT for Windows (OpenGL Utility Toolkit) from Nate Robins’ web page. I put it on my C drive. The current documentation for GLUT tells you to go into the glut project folder and build the glut.dsw Visual Studio project. This is a little misleading since there is no glut.dsw file and all the dll, lib etc files you need are already there! So don’t worry about doing this, just download it.
Create a Visual Studio Project such as a new Console Application. For Windows XP: paste the glut32.dll file into: C:\Windows\System32. For Windows 7: place the glut32.dll inside the C:\Windows\SysWOW64 folder instead.
In the Project properties, select C/C++ -> General -> Additional Include Directories and add the location of the glut.h header file. This might be C:\glut-3.7.6-bin\
In the Project properties, select Linker -> General -> Additional Library Directories and add the location of the glut libraries eg C:\glut-3.7.6-bin\
In the Project properties, select Linker -> Input -> Additional Dependencies and add “glut32.lib”.
It should then compile. For a more detailed explanation, plus advice for installing the latest Windows Drivers from the Intel site, see this blog post.
Your error message lists all missing files in the same error.
That means you didn't set your dependencies correctly, because the linker searched for the file "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib", which doesn't exist, of course.
The file names have to be separated by ";" in the Additional Dependencies section (under Linker > Input).
Or, if you use the edit menu by choosing it from the drop-down selection, each dependency has to be in a new line.
So you have to write "GIU32.lib;OpenGL32.lib;freeglut.lib;glut32.lib".
If error persists, you just put the libs in wrong place. Try to define additional lib path in project properties (sorry, I don't have VS 2010 around to show you exact location).
The DLLs need to be in BOTH system32 and syswow64
See here:
http://www.james-bennet.com/2011/10/using-glut-under-visual-studio-2010/
Has a HOWTO including a screenshot of the linker options you need to set.

Qt for windows CE

I have installed Qt for windows CE using this link http://qt.nokia.com/products/platform/qt-for-windows-ce for visual studio8, I can see Qt tab in VS IDE.
I tried to create new application for QT am getting error that
"There are no Qt/CE platforms defined. Please add your Qt/CE build in the Tools/Options/Qt/Builds dialog."
How can i define platform??
As it explains in the error. Go to tools menu, then options submenu. Select Qt from the tree and then select Builds item. There you will see an Add button. Click it. Write the version and path of your installed Qt. Then you are good to go.
Okay, I click Tools, select the "Options…" menu item (it is not a submenu), up comes the "Options" dialogue box, I see no "Qt" entry in the tree. Fresh never-used-before install of Visual Studio 2008 on Windows XP Pro SP3, with Qt add-in installed and I've tried running it as an Administrator too.
Did I miss something?
In the meantime, I have discovered some notes here:
http://www.sereno-labs.com/qt-4-6-2-installation-procedure-friendlyarm-mini-2440-windows-ce-5-0
The device I'm targeting is not a FriendlyARM, rather a Psion hand-held, but nevertheless, suggests that the bare Qt package lacks any VisualStudio binaries.
Further update…
My aging P4 laptop is busily compiling Qt now, has been for some hours. I found that for the Psion, I had to edit the setcepaths.bat script to make the call to checksdk.exe consistent with the SDKs actually provided. Upon doing this, things seem to be working. If you get an error message regarding a missing header, run:
checksdk.exe -list
That'll tell you what your SDK is actually called. You might find then that running:
checksdk.exe -sdk "Your SDK with spaces (and ARCH in brackets)" -script tmp.bat
tmp.bat should produce the needed environment.
Lastly, I hit a compiler error due to some left-over autogenerated files in the Qt build directories. I'll post up the (Cygwin) command I used to clean up the sources mid-build when I find it.

Resources