-
-
- After several weeks, I give up; I’m asking.
-
- I have the MS books on Using VC++ and Programming for Windows, as well as a couple third-party books on game programming. All claim to address using VC++ ver 5 or 6; I have ver 6. I want to play with DirectX stuff and the game books provide examples, but I can’t: none of the books I have tells how to add libraries or header files to a project. At least, if it does, I can’t find it. One refers to a menu with tabs, that I cannot find. I kept going back and forth, thinking it was me, but it’s Just Not Fucking There. In the project file, there’s a folder for header files, but for a Windows application the only header file used goes into the “external dependencies” folder. - There’s a couple of MS books that I don’t have yet (DirectX and D3D) so one of those might say how, I don’t know. If I want to add the DirextX headers & lib files, how do I do it? - MC
Here’s what you do:
You have to a project loaded for this to work. So create a new one or load the one your using.
From the Project Menu select Settings.
Then, in the Settings For dropdown list box on the top left of the dialog select All Configurations.
Click on the Link Tab on the right hand side of the dialog box.
In the Object/library Modules text box add some of the following to the end of the other .lib files already in there:
DXGuid.lib <- always add this one
ddraw.lib <- direct draw
dsound.lib <- direct sound
dinput.lib <- direct input
…
whatever you want to use
Then close that dialog, saving your changes
From the Tools menu select Options
Another Dialog box comes up, select the Directories tab.
In the Show Directories For: drop down list select Include Files
Add the directory for the DirectX header files into the list at the bottom of the dialog (make sure that your entry is above the other default entries)
Then change Show Directories For: to Library Files and add the directory for the DirectX library files there.
I think that’s all you need to do configuration wise to get DirectX to work. But it’s been a while, so I may have missed something.
Some things I left out above. I think that DirectX has special Debug libraries that you can use when in debugging mode. Instead of using the regular libs for All Configurations you may wish to use the debugging ones for Debug Mode.
Also, I’m not really sure what DXGuid.lib does, I just know that I’ve never gotten DirectX to work without linking it. YMMV.