Dev-C++ and DirectX9

Started by
35 comments, last by cellman 18 years, 9 months ago
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!
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
Advertisement
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.
d3d9.lib is the import library for the Visual Studio linker, the file you want is libd3d9.a which is the MinGW version.
Thanks. I'm using the book Beginning Game Programming, and even though it coumes with Dev-Cpp, it covers MSVC6. Thanks again!
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
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#.
Rob Loach [Website] [Projects] [Contact]
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?
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
afaik, #pragma comment(lib,..) is msvc-specific. try adding -ld3d9 to your linker-step.
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++

link to these files in the project->parameters->linkers

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 ;)

Blekinge Institute of Technology
Twitter [twitter]devmoon[/twitter]
Homepage http://devmoon.se
Stream http://twitch.tv/devmoon
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!
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
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
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.

This topic is closed to new replies.

Advertisement