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

Started by
14 comments, last by Boder 18 years ago
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]
Advertisement
Quote:Original post by Boder
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]


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.
This space for rent.
Quote:Original post by Drew_Benton
Quote:Original post by muffinhead
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


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
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
Quote:Original post by Boder
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


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.
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.

This topic is closed to new replies.

Advertisement