Sign in to follow this  
Jacob Roman

DirectX9 SDK Question [RESOLVED]

Recommended Posts

Jacob Roman    120
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]

Share this post


Link to post
Share on other sites
Jacob Roman    120
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?

Share this post


Link to post
Share on other sites
Armadon    1091
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.

Share this post


Link to post
Share on other sites
Darkneon    166
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.

Share this post


Link to post
Share on other sites
Jacob Roman    120
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this