Public Group

# Dev-C++ and DirectX9

This topic is 4763 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
19
5. 5

• 14
• 26
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631770
• Total Posts
3002251
×