DirectX9 SDK Question [RESOLVED]

Started by
4 comments, last by Jacob Roman 18 years, 8 months ago
After installing the SDK, do I need to manually put the Include files in the Visual Studio .NET's Include folder in order to get the DirectX9 stuff working? The EXE's work without having to do this, but the source code files is whats not working cause of the missing Include files. Also, are there any other files I need to copy and paste before proceeding? [Edited by - Jacob Roman on August 4, 2005 8:15:55 PM]
Advertisement
In the ReadMe, it says this

Quote:
Be sure to set the paths to the DirectX 9.0 lib and headers within Visual Studio. They must be listed first. Otherwise you may experience compiler errors.


Where do I do this?
Hi Jacob Roman,
How are you doing?

[How to link the libraries and headers?]
Example
[source lang = c++]#include <d3d9.h>#include <d3dx9.h>#pragma comment(lib, "d3dx9.lib")#pragma comment(lib, "d3dx9d.lib")#pragma comment(lib, "d3d9.lib")#pragma comment(lib, "d3dx.lib")#pragma comment(lib, "DxErr9.lib")

PS: #pragma comment() works with devc++ and VS.NET
I hope this helps.
Extras/Options/Projects/VC++ Directories
Jacob Roman, when you compile, what kind of errors do you get? Is the compiler complaining about a type or namespace? Are you using C#?

If so, press Ctrl+Alt+L, and at the top right you should see a small window. In it, it says "References", right click on it and click "Add Reference". In the .Net tab, look for "Microsoft.DirectX" and click select, then look for "Microsoft.DirectX.Direct3D" and click select again. Finally, look for ""Microsoft.DirectX.Direct3DX" and once again click select then OK.

In your source code file, you need to add those two lines at the beginning (or after the usings...)

using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;

You're set.
I figured it out. Nevermind guys. All I had to do was go up to Tools > Options... And go into Projects > VC++ Directories. Next I use the combobox and select "Include files" and add the path to the SDK's include directory. Then I went to the combobox again and selected "Library files" and add the path to the SDK's lib directory. Ran the source code, it worked like a charm.

This topic is closed to new replies.

Advertisement