# Dev-C++ and DirectX9

## Recommended Posts

Sorry if this belongs in the DirectX forum, but I'm still a "beginner", so... I'm making a program with Dev-Cpp that uses Direct3D. When I go to compile, I get the error "[Linker Error]: undefined reference to Direct3DCreate9@4". I also get something like "[Linker Error] undefined reference to _gxx_personality_v0" (a line wich I have nowhere in my code). I know I set it to link to the d3d9.lib file in both the compiler options and the project options menu, and i included d3d9.h does anyone know what could be wrong? Thanks!

##### Share on other sites
You need to include the library files do something like this your cpp or h file.
#pragma comment(lib, "libd3d9.a")

This may help, even though its for directx8.

##### Share on other sites
d3d9.lib is the import library for the Visual Studio linker, the file you want is libd3d9.a which is the MinGW version.

##### Share on other sites
Thanks. I'm using the book Beginning Game Programming, and even though it coumes with Dev-Cpp, it covers MSVC6. Thanks again!

##### Share on other sites
If I were you, I'd ditch Dev-C++ and use Visual Studio. Not only is a better IDE, in my opinion, but also seems to be more stable with the environment. You might also want to have a stab at Managed DirectX using C#.

##### Share on other sites
Thing is, Visual Studio costs money, and Dev is free. Except for 2005 Express Edition. I think I'll go with that. Does that work with DirectX? Also, I added the line #pragma comment(lib, "libd3d9.a") and I still get the linker errors. I think it's because I don't have that file; does anyone know where I can get it?

##### Share on other sites
D:/Program/Dev-Cpp/lib/libd3dx9.a
D:/Program/Dev-Cpp/lib/libwinmm.a
D:/Program/Dev-Cpp/lib/libd3d9.a
D:/Program/Dev-Cpp/lib/libdinput8.a
D:/Program/Dev-Cpp/lib/libdxguid.a

these are the libs that im linking to often
and are u sure u have the directx pack for DeV c++

i love Dev Cpp and think it has good interface and is free
on the other hand it can be quite unstable : /

well i it works ;)

##### Share on other sites
OK, so I go into Project Options, I go to Parameters, I go to the linker field, and I type: -l the full path leading to my d3d9.lib file. Now when I compile, I get [Build Error] Error 1. This is making me mad... plz help!

##### Share on other sites
Sorry, I didn't see the last post. No, I don't have the DirectX pack for Dev-Cpp. Does anyone know where I get it? Thanks... again

##### Share on other sites
try the WebUpdate tool that comes with Dev-C++. it should list availible packs.

##### Share on other sites
VUpdate says "Error: Server Temporarily Down?" Is there anywhere I can download the pack manually?

##### Share on other sites
I don't think you can get that pack anymore for legal reasons. My problem is that I have the .a files but there is no such d3dx9.h file in the dev-cpp include dir. I need to use this particular file though.

##### Share on other sites
is it any other way to use directx with dev cpp without the directx dev pack??

and why did they delete it :S

i have the dev pack atleast

##### Share on other sites
So you can't get the Dev-pack anymore? And you can't make DX stuff with Dev unless you have the pack?? So I'm totally at a programming roadblock until I get broadband internet and can download the massive MSVC Express??? ARRRGGGHHH!!! Are there any other free C compilers out there that work with DX9 and won't take several years to download with dial-up?

##### Share on other sites
Read this, check out who gets mentioned in the credits for that [smile].

##### Share on other sites
I am pretty sure that reimp doesnt come with devcpp. That and the newest version has .a files for directX crap. The thing it is missing is a d3dx9.h .

##### Share on other sites
Quote:
 Original post by MikeWulfI am pretty sure that reimp doesnt come with devcpp. That and the newest version has .a files for directX crap. The thing it is missing is a d3dx9.h .

You just need to copy over the headers from the dxsdk include directory to the MinGW one.
As stated reimp comes with MinGW Utilities, download, extract, copy over to the DevC++ directory.

##### Share on other sites
Oh, sorry. It's just in the article it seemed as if you were referring to the mingw that comes with devcpp.
Edit> Okay, I did that. Now everything is fixed besides:
[Linker error] undefined reference to `timeGetTime@0'
Might you know what that one is?
editedit> Nevermind. I searched the msdn. Thanks for all the help dude! Make sure your answers here gets in the devcpp wiki. You know, since you don't have to do all that crap with the reimp in the latest version of devcpp.

[Edited by - MikeWulf on July 5, 2005 12:55:06 PM]

##### Share on other sites
OK, what am I supposed to do with the mingw-utils-0.3.tar.gz file after I download it?
Edit: Does Dev-cpp version 4989 come with the DX libs? Just wondering.

##### Share on other sites
I think that there is a different set of directX files to use with bloodshed compilers (or maybe just non-Visual C++ compilers). maybe you should try those.

##### Share on other sites
Quote:
 Original post by programwizardOK, what am I supposed to do with the mingw-utils-0.3.tar.gz file after I download it?Edit: Does Dev-cpp version 4989 come with the DX libs? Just wondering.

Extract it, Winzip or Winrar will do, then copy the extracted directories to your DevC++ directory, check that you copy the files in bin to bin, lib to lib, etc.

You still need the DX SDK to get the headers, I dont know if DevC++ comes with the lib.a files for DX, MinGW does, however notice that those may not be the most recent ones, use reimp to convert the .lib files on the DXSDK into lib.a to be used with MinGW/DevC++.

##### Share on other sites
I don't know if I am meant to do this or not but I made an entry here http://nexe.gamedev.net/directKnowledge/default.asp?p=DirectX+Development+Using+DevCpp I hope this solves it for you.

##### Share on other sites
Quote:
 Original post by MikeWulfI don't know if I am meant to do this or not but I made an entry here http://nexe.gamedev.net/directKnowledge/default.asp?p=DirectX+Development+Using+DevCpp I hope this solves it for you.

c:\devcpp\include would be a much better option than c:\devcpp\include\c++, not only because gcc (unlinlike g++) does not automatically adds that directory to the include directories, but also because the c++ directory is a system include directory, you shouldnt mess with it.

##### Share on other sites
Sorry. I only assumed to put it in there because it was C++ and, well, so is the DirectX files.

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627653
• Total Posts
2978433

• 10
• 12
• 22
• 13
• 33