Archived

This topic is now archived and is closed to further replies.

guy_with_a_pexel

Problem linking libraries

Recommended Posts

I just finished with c++, now I am wanting to get into directX, but I can''t seem to find how you link the directX libraries using dev c++. Cna anyone give me step by step instructions? Thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It''s just not that simple. DirectX is a collection of APIs such as Direct3D, DirectSound, DirectShow, etc. First, you have to know which API you are going to be using. Then, you can figure out which library(s) to link to.

Share this post


Link to post
Share on other sites
There is no linking to an API, there is only linking to libraries.

First, figure out what your trying to code, then go to the MSDN and figure out what libraries youll need. For DirectPlay, youll most likely need to include dplay8.h

You can set your includes under

project > settings > link.......then add the library you want to ad manually in the text field.

Share this post


Link to post
Share on other sites
Start by writing simple WIn32 applications, if you havent allready.
If I recall, you need to include d3d9.h and link to d3d9.lib..
Though, I''m not 100 % if the file names are exact.

Share this post


Link to post
Share on other sites
DevC++ uses Mingw32 as the compiler, which is a Windows port of gcc. The library (object) format MSVC understands is not understood by gcc, so you need to get the files in a format that it understands. At the DevC++ website (and with the included update utility) you can download packages that contain library files gcc can understand. Your first step would be to get the DirectX 9 package and install it. Then, in the DevC++ project settings, there is a place where you can type in the names of the libs to link to. As I recall there is a browse feature so you can just select the libs you want.

Another thing to keep in mind is the naming convention. When using other Win32-based compilers you link to somelib.lib. But with gcc compilers you link to libsomelib.a. So d3d9.lib is not what you would put in the project settings, but libd3d9.a instead. Just bop around the DevC++ website a bit and you''ll find what you need.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
with dev c++ just run the updater and choose the DX9 package and download it. i think it has some example projects, so you can look how to link to the library.

Share this post


Link to post
Share on other sites