Help with setting up directx sdk with c++

I've set up the paths for the sdk(using visual c++) but when I use any of the sample codes from the sdk I get errors. Do I need to include anything else?

I have visual c++ express direct x sdk and windows sdk installed
closed account (zb0S216C)
I'm assuming you're getting linkage errors, specifically: Undefined reference to Direct3DCreate9@4?

If the errors pertain to the linker, link theses libraries: d3d9.lib and/or d3dx9.lib. Note that the extension of the libraries maybe .a.

Can you provide any more information?

Wazzak
Last edited on
Read relase notes when download :D

DirectX SDK Does Not Register Include/Library Paths with Visual Studio 2010

With Visual Studio 2010, the model for adding include, library, and executable paths has changed. In Visual Studio 2008 and previous versions, paths were specified as global settings under Tools\Options. With Visual Studio 2010, paths are now specified on a per-project basis on a VC++ Directories page. All the Visual Studio 2010 projects for the DirectX SDK samples and tools include direct per-project references to the DirectX SDK--via the DXSDK_DIR environment variable--and will compile without any additional steps. New projects that make use of DirectX SDK headers, libraries, or tools should have these references added to the VC++ Directories property page. For more information, see the topic "Installing DirectX with DirectSetup" in the section titled "Install the DirectX SDK", as well as the Visual Studio team blog entry:
http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx
The error says

Fatal error C1083: Cannot open include file: 'resource.h' : No such file or directory

I'm guessing that means "resource.h" is no included with what I included. The files I included are above.
go to project root and check if there is resource.h.

if it isn't then you know the problem :)
How do I check for the resource.h also how can I get it or do I have to create it I'm just trying to see if I can get visual c++ to work with direct x sdk before I start learning it
Visual C++ work with direct X SDK just fine.

resource.h is created automaticaly when you create new project or add *.rc file.
goto: add new item > resource > icon

now you'll have resource.h in your project :D

I went to PROJECT > ADD NEW ITEM but when I get there the only choices are windows form, c++ file, header file, property sheet, and component class.
Right click on project > add > resource > icon

maybe you don't have this option in express edition...
if so, remove #include <resource.h>
Last edited on
Ya it's not there and if I remove resource.h it won't compile and its "resource.h" and if I switch it to <resource.h> then it still doesn't work
Here is an example from my comp:
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++


every sample project has it's own resource.h...

I'm not shore why you don't have it.
check your "Samples" folders for each sample project, it should have resource.h there.

also Windows SDK already includes Direct X libraries so no need to install Direx X if you have Windows SDK already :)

Here is one solution:

right click on resources folder in your project > add exiting item > locate resource.h in your sample project directory

it must be there.


Here is a screenshot on what to do exacly:
http://api.ning.com/files/pyfpSV4uB22gbJHeqSF1wrdGP9aLM2JwhxTGO*v2sRumboBOeBGEeABzmTfajkK9axCuxOlJtXbXnELcqRzF4QFocHWwjvg7/Capture.PNG
Last edited on
Topic archived. No new replies allowed.