Sign in to follow this  
mageofdreams

Novice in need!

Recommended Posts

Hello all, I just joined today and I'm still feeling my way around. How is everyone? I'm having a programming problem using DirectX in C++. Someone please help me! Or if this is not the correct place to start this kind of thread, please direct me to the right board. I'm using Dev-C++ and trying to compose a sample program from a book. It's to create a window that will later be used for a game using DX9. But the book explains how to link the "d3d3.lib" file using Visual C++ and it doesn't seem to work for my compiler. Can anyone help me? What could I use to link my program to DirectX? Or should I try to explain the problem more clearly? Sincere thanks, Mageofdreams

Share this post


Link to post
Share on other sites
The dev-c++ uses the mingw32 c++ complier which is different from the visual c++ complier, so when u try to link a library that has been complied using the visual c++ complier, u will have error, because the library is not 'compatible' with it.

The solution is either to compile the DirectX SDK for Dev-C++ or to download a devpak for dev-c++ that provides the DirectX libraries that have been compiled for mingw32. If u look for the devpak download in the Dev-C++ IDE, u should be able to find them available for download.

Share this post


Link to post
Share on other sites
First you need to add the include and lib paths to your compiler options. In Dev-C++ click Project->Project Options... This will open a dialog with some tabs. Click the one that says Directories. Under Library Directories, click the Add button and browse to the DirectX lib path on your machine. For example mine is C:\DXSDK\Lib. The do the same thing for the DirectX include path under Include Directories. Then click the Parameters tab and add d3d9.lib to the textbox on the far right labeled Linker. Hope that works out for you.

-AJ

Share this post


Link to post
Share on other sites
Quote:
Original post by Jackrhino
The dev-c++ uses the mingw32 c++ complier which is different from the visual c++ complier, so when u try to link a library that has been complied using the visual c++ complier, u will have error, because the library is not 'compatible' with it.

The solution is either to compile the DirectX SDK for Dev-C++ or to download a devpak for dev-c++ that provides the DirectX libraries that have been compiled for mingw32. If u look for the devpak download in the Dev-C++ IDE, u should be able to find them available for download.


I've heard of that problem before, but I've never had any trouble compiling DX apps under Dev-C++. To the OP, try both and whichever one works, best of luck to you.

-AJ

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