Sign in to follow this  
programwizard

Dev-C++ and DirectX9

Recommended Posts

programwizard    100
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 this post


Link to post
Share on other sites
Rob Loach    1504
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 this post


Link to post
Share on other sites
programwizard    100
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 this post


Link to post
Share on other sites
Hunter_Ex    976
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 ;)

Share this post


Link to post
Share on other sites
programwizard    100
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 this post


Link to post
Share on other sites
MikeWulf    100
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 this post


Link to post
Share on other sites
programwizard    100
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 this post


Link to post
Share on other sites
MikeWulf    100
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 this post


Link to post
Share on other sites
Kwizatz    1392
Quote:
Original post by MikeWulf
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 .


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 this post


Link to post
Share on other sites
MikeWulf    100
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 this post


Link to post
Share on other sites
KittyRa    262
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 this post


Link to post
Share on other sites
Kwizatz    1392
Quote:
Original post by programwizard
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.


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 this post


Link to post
Share on other sites
MikeWulf    100
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 this post


Link to post
Share on other sites
Kwizatz    1392
Quote:
Original post by MikeWulf
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.


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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this