Novice in need!

Started by
2 comments, last by u235 17 years, 11 months ago
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
Advertisement
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.
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
V/R,-AJThere are 10 kinds of people in the world: Those who understand binary and those who don't...
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
V/R,-AJThere are 10 kinds of people in the world: Those who understand binary and those who don't...

This topic is closed to new replies.

Advertisement