Visual C++ Direct X .lib files help

Started by
1 comment, last by phasmx 18 years, 10 months ago
Hey everyone, I have a question. First off I am pretty experienced in c++ i know a good amount to start programming games, in which my question is based upon. I have read the book "Tricks of the Windows Game Programming Guru's" and im trying to try out the demos in it. What i have to do is include some .h's some .cpp's, the .bmp's, the .wavs, and the .lib files. I know how to include everything into a project and i know how to compile and everything to do in Borland C++, but the only problem is that he uses Visual C++ in the demos and he only has the files in it that supports only Visual C++, I obviously do not have experience with Visual C++ the program, not the language i know the language, I was wondering if anyone could maybe gives me the steps to take on how to add those files in visual c++ and how to compile in visual c++, if not if you know of anyone who can go over it with me or how i can learn how to use the program itself, visual C++. I would really appreciate someone who can personally help me through the steps. Thanks in advance everyone. -Phasmx
Advertisement
My preference is to take the lazy approach and that's to put the following anywhere in your code (safest place is your main.cpp or WinMain.cpp file):

#pragma comment(lib, NameOfLibrary.lib)

for example:
#pragma comment(lib, winmm.lib)
#pragma comment(lib, d3d9.lib)
#pragma comment(lib, d3dx9.lib)
if you want to include winmm.lib, d3d9.lib, and d3dx9.lib.

Alternatively right click your project, hit properties, hit linker, hit input, and in the "additional dependencies" box, type in all the libraries you want to include, separated by a single space.

for example:
winmm.lib d3d9.lib d3dx9.lib
et cetera.

Good Luck!
Hey thanks for helping me out by the way, I followed your instructions and so far so good up until i compile it, when i compile it, it says "Cannot open include file: 'dmksctrl.h': No such file or directory". Now obviously what i did was include dmksctrl.h, and i do believe i might have to have it in the same folder as the project. I know that in borland you have to have all the files including the .h's .cpp's images, sounds and whatever in the same file in order to compile but what folder do i have to put all these in in this case, the folder that i use for this i didn't include the folder(and do not know how) but the folder i use i just included the files from in it. Or if iam wrong on that fact what do i have to do in order for it to compile, i apprecaite your help so far. Thanks in advance.

This topic is closed to new replies.

Advertisement