# How Do I set Up Dev-C++, Or Codeblocks IDE to use the DirectX SDK?

## Recommended Posts

##### Share on other sites
If you want to use DevCpp take a look at this thread. If you run into any more troubles, just let us know, good luck!

##### Share on other sites
Quote:
 Original post by muffinheadI cannot afford to buy expensive IDE's like microsoft visual studio

You can't afford something that's free?

You can do what you want to do with Dev-C++ or Code::Blocks, but it'll take some work. You might want to look of DirectX "DevPaks" for Dev-C++, although they should also work for Code::Blocks since they use the same compiler.

Edit: Err nevermind. Listen to Drew.

##### Share on other sites
I knew the beta of Visual Studio 2005 was free, But I thought that ended last year. Anyways it was hard enough for me to download the directX SDK, On Dial Up With Download Accelerator Plus, let alone the visual studio beta.

Thank you though, I'll have a look at the thread you mentioned, I hope it's a little more cleary explained than nexe's website, Because I'm a beginer at all of this, So I have a little more difficult time understanding it, But am willing to put forth the effort to learn. Thanks a bunch.

##### Share on other sites
Sorry I'm Double Posting, but I followed the direction's on the link that
Drew_benton gave, I downloaded the mingw runtime libraries/utilities, the d3dx9d.dll, and linked the necessary libraries, but when I go to test if it's set up correctly by trying to compile the d3d simple basecode off of nehe's website, I get tons of compile errors such as,

"Dx9/D3dx9.h: No such file or directory", "Dx9/D3d9.h: No such file or directory",

C:\Documents and Settings\***\My Documents\My Completed Downloads\nehed3d_simple\nehed3d_simple\Simple Basecode\Main.cpp LPDIRECT3D9' does not name a type,

C:\Documents and Settings\***\My Documents\My Completed Downloads\nehed3d_simple\nehed3d_simple\Simple Basecode\Main.cpp LPDIRECT3DDEVICE9' does not name a type,

C:\Documents and Settings\***\My Documents\My Completed Downloads\nehed3d_simple\nehed3d_simple\Simple Basecode\Main.cpp In function void ReSizeD3DScene(int, int)': ,

C:\Documents and Settings\***\My Documents\My Completed Downloads\nehed3d_simple\nehed3d_simple\Simple Basecode\Main.cpp D3DXMATRIXA16' undeclared (first use this function).

I also get a lot of other compile errors also, but am not going to list them.
Is there a special syntax that Dev-C++ uses or codeblocks IDE uses, that makes traditional C++ Syntax not compatable with Dev-C++ or Codeblocks?

I Tried finding a Dev-C++ Translation of the D3D Simple Basecode, but there wasn't any.

If Someone can help me with this problem, I'd really appreciate it, Thanks a bunch.

If it helps any I'm using the latest DirectX SDK (Febuary 2006), Dev-C++ beta 5 (4.9.9.2), and Codeblocks v1.0 release candidate 2. Thanks a bunch once again if you can help me.

[Edited by - muffinhead on April 2, 2006 1:52:54 PM]

##### Share on other sites
Quote:
 Original post by muffinheadI followed the direction's on the link that Drew_benton gave, I downloaded the mingw runtime libraries/utilities, the d3dx9d.dll, and linked the necessary libraries, but when I go to test if it's set up correctly by trying to compile the d3d simple basecode off of nehe's website, I get tons of compile errors such as

That is just because your header files are not being included properly. If you look at the project that I linked to at the end of my post, you will see that all I did was put an absolute path:
#include "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include\d3d9.h"#include "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include\d3dx9.h"

Because that is where my header files are. You will need to do the same, just use your absolute path to your Feb SDK, and your problems should go away. Give that a try and let us know!

##### Share on other sites
Quote:
Original post by Drew_Benton
Quote:
 Original post by muffinheadI followed the direction's on the link that Drew_benton gave, I downloaded the mingw runtime libraries/utilities, the d3dx9d.dll, and linked the necessary libraries, but when I go to test if it's set up correctly by trying to compile the d3d simple basecode off of nehe's website, I get tons of compile errors such as

That is just because your header files are not being included properly. If you look at the project that I linked to at the end of my post, you will see that all I did was put an absolute path:
#include "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include\d3d9.h"#include "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include\d3dx9.h"

Because that is where my header files are. You will need to do the same, just use your absolute path to your Feb SDK, and your problems should go away. Give that a try and let us know!

I Did As You Said and included my absolute path in the code, to the DirectX SDK, But I am still getting compile errors. I think I may not Be linking the libraries Properly, and Including the Include Files From the DirectX SDK Properly. That thread On How to set it up, didn't mention how to link the Libraries, and Include the include file's from the SDK. Maybe you might be able to tell me how.

I Would like to know the Instructions on how to link the libraries and Include the Include Files From The SDK Properly, In the Codeblocks IDE, And Dev-C++ If Possible.

Yes I read your Post in the other Thread, and I couldn't grab the concept on how to link the libraries, and include files from the SDK, as It didn't explain on how to do this.

I don't want to feel like an total Failure, and Have Been really Looking Forward to game deving for a long time. I'm New to all this, but am willing to take the time, and Put forth the effort to learn, and become successful at this.

I really want to learn How to create the games, for so long that I Played, and Seems Like a Challenge for me. I'm Starting out small and working my way Up.

If you can Help me once again, that would be great, and Thanks a bunch once again. Sorry If I'm a Bother, I don't mean to be, but this is all new to me, and quite confusing. I have had some Programming experience in college, but not much because of dropping out, But plan on going back to finish my degree Very Soon.

##### Share on other sites
Quote:
 Original post by muffinheadI Would like to know the Instructions on how to link the libraries and Include the Include Files From The SDK Properly, In the Codeblocks IDE, And Dev-C++ If Possible.

For DevCpp, take a look at my post here at step #8. It tells how to link in the libraries. Make sure that you use the libraries that I mentioned on the other thread:
Quote:
 10. For any new project you make you will need to link in these libs:-lmingw32-ldxguid-ld3dx9d-ld3d9

So, once you do that, all you have to do is make sure that you #include your header files for the DirectX files. After that, it should work.

If you are still having troubles, use that project that I made on the other thread. All you have to do is change the #includes to reflect where your header files are. See if you can get that to work, let us know if you run into any other problems. Good luck!

##### Share on other sites
I believe he was referring to Visual C++ Express edition which is free ;-) and only about 50mb

##### Share on other sites
Thanks Drew, I Think I finally got it set up right, however there are some minor errors with compiling the simple base code, Like when I go to compile it, It say's In the compiler output/Info box, "Warning: No new line at end of file", However It Compiles successfully anyway, and I'm able to run the compiled Simple basecode app.

What does "Warning: No new line at end of file", Mean anyways?

However Thanks for the help, and Hopefully now I can get started, I'll Post back If I run into any more major problems again.

##### Share on other sites
The newline character sequence is usually generated when you hit "Enter" or "Return" on the keyboard. Compilers like for the newline to be the last thing in a source file because it can help with parsing using functions like fgets().

Just go to the last line in the file and hit "Enter" to rid yourself of that little warning [smile]

##### Share on other sites
Quote:
 Original post by BoderThe newline character sequence is usually generated when you hit "Enter" or "Return" on the keyboard. Compilers like for the newline to be the last thing in a source file because it can help with parsing using functions like fgets().Just go to the last line in the file and hit "Enter" to rid yourself of that little warning [smile]

actually it can (or used to) lead to parsing problems like this:
#ifndef BLAH_H#define BLAH_H// stuff...#endif

note that there's no newline at the end. now say the first line of the next file is:
#include <cstdlib>

now the preprocessor has read this as:
#endif#include <cstdlib>

i'm not sure if any modern compilers will have this problem, but it's good habit to add a newline just in case.

##### Share on other sites
Quote:
Original post by Drew_Benton
Quote:
 Original post by muffinheadI followed the direction's on the link that Drew_benton gave, I downloaded the mingw runtime libraries/utilities, the d3dx9d.dll, and linked the necessary libraries, but when I go to test if it's set up correctly by trying to compile the d3d simple basecode off of nehe's website, I get tons of compile errors such as

That is just because your header files are not being included properly. If you look at the project that I linked to at the end of my post, you will see that all I did was put an absolute path:
#include "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include\d3d9.h"#include "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include\d3dx9.h"

Because that is where my header files are. You will need to do the same, just use your absolute path to your Feb SDK, and your problems should go away. Give that a try and let us know!

Sorry to quote you again drew, but as I noticed including the absolute path to the header files in my directX SDK requires for me to edit the source code.

I have Just downloaded the quake 3 source code from fileshack, and another DirectX Example that have multiple files and pages of source code, and Will obviousely take to long to edit it to include the absolute path to the header files in the DirectX SDK.

My question is, that I want to be able to compile the source code on these files/projects as quickly as Possible, without editing the source code (editing the source code would take to long for what I nee it for), I am doing this, so I have an example to go by, when I start devoloping, so I'm not as lost trying to figure it all out.

Is there a quiker way to include the header files from the DirectX SDK For Source code I've downloaded legally, without editing any of the source code for a quick compile? If so can you please tell me how, thanks a bunch

##### Share on other sites
For Dev-C++, go to "Tools->Compiler Options" then Directories.
For Code::Blocks, go to "Compile->Compiler Options" then Directories.

Add "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include" to either the C++ tab (Dev-C++) or to the Compiler tab (C::B).

Add "C:\Program Files\Microsoft DirectX SDK (December 2005)\Lib" to the Lib or Linker tab.

Hopefully, that helps [smile]
Also check Beginner FAQ

##### Share on other sites
Quote:
 Original post by BoderFor Dev-C++, go to "Tools->Compiler Options" then Directories.For Code::Blocks, go to "Compile->Compiler Options" then Directories.Add "C:\Program Files\Microsoft DirectX SDK (December 2005)\Include" to either the C++ tab (Dev-C++) or to the Compiler tab (C::B).Add "C:\Program Files\Microsoft DirectX SDK (December 2005)\Lib" to the Lib or Linker tab.Hopefully, that helps [smile]Also check Beginner FAQ

I don't mean to be a bother, But I had already configured that the right way, btw in codeblocks v1.0 release candidate 2, Compiler options is in Settings->Compiler.

I've already included The DX SDK Includes and header files, under the directories and linker tab, But still I get compile errors during compile. the only way I don't get compile errors, is if I Modify the source code, to Point towards "C:\Program Files\Microsoft DirectX SDK (Febuary 2006)\Include\d3dx9.h/d3d9.h" , which is the files in my include directory, for the MS DX SDK.

As You see I don't want to modify the source code for open source programs, I downloaded off of the internet, and Some Of the open source code is pretty long.

I Just want a quick compile W/O having to modify any of the source code, From the Open source Code I downloaded, Such as the quake 3 Source code.

The DirectX SDK IS already set up properly for Dev-C++ and codeblocks, the Only time I want to work on and Modify the source code is when I create a project myself from scratch, not with anyone else's source code. So I don't have to Manually modify/edit the source code to point towards or say, "C:\Program Files\Microsoft DirectX SDK\Include\d3dx9.h/d3d9.h

I don't think I'm being clear enough, as I've been really tired lately but I'll try again.

Is there Any way to Include my DirectX Include files from the SDK, such as d3dx9.h, or d3d9.h, without modifying the source code, So I don't ge compile errors such as: <d3x9.h> No such file or directory, or <d3d9.h> No such file or directory?

Specifically I'm trying to compile the quake 3 source code, and some other DirectX examples/sourcecode, and these are too long to manually go through and edit, to point toward the directory/File <d3dx9.h> in the directX SDK
Include directory.

Sorry I'm not trying to be a pain, I'm Just new to all of this, and don't know how to set it all up, I'm trying my best, I'll also be studying some C++ tutorials, and books to pick up on all of this. Thanks a bunch if you can help me once again.

Btw thanks boder for trying to help, but I already had all that set up correctly.

##### Share on other sites
Using Code::Blocks, I highly recommend using the Microsoft C++ Toolkit from 2003.

Make sure you have those settings correctly and for the correct compiler.

Then whenever you have "#include "d3d9.h" the compiler should find it. Also when you have "d3d9" in the linker setting it should search all the directories in your settings and find the library.

But if you have "dx9/d3d9.h" it won't find it, I don't know why it would be typed like that.

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627662
• Total Posts
2978516

• 10
• 10
• 12
• 22
• 13