[size="2"][font="Arial"][size="2"]Now that we have decided the basic directory structure and dependencies that each project will have, we will now set the project properties. I prefer to do this at the project level so that the properties are persistent and I don't have to set them every time I download the project. The steps are based on Visual 2008 Professional, but you can adapt them to a different IDE as well
[/font]
[size="2"][font="Arial"][size="2"][subheading]Setup the Main Exe Project[/subheading]
[/font]
- [font="Arial"][size="2"]Create an Win 32 Project and delete all the files except for stdafx.h, stdafx.cpp (I named the project as Main)
- [font="Arial"][size="2"]Create a new folder called src and move the above files in there (I prefer all my source files in one main directory )
- [font="Arial"][size="2"]For Both Release and Debug Modes
- [font="Arial"][size="2"]In the tab C/C++ -> General -> Additional Include Directories add
- [font="Arial"][size="2"]"$(SolutionDir)Common\src"
- [font="Arial"][size="2"]In the tab Debugging -> Working Directory add
- [font="Arial"][size="2"]..\..\Debug\
- [font="Arial"][size="2"]..\..\Debug\
- [font="Arial"][size="2"]$(OutDir)/$(ProjectName)_D.exe
- [font="Arial"][size="2"]..\..\Debug\
- [font="Arial"][size="2"]Utilities_D.lib
- [font="Arial"][size="2"]In the tab Debugging -> Working Directory add
- [font="Arial"][size="2"]..\..\bin\
- [font="Arial"][size="2"]..\..\bin\
- [font="Arial"][size="2"]$(OutDir)/$(ProjectName).exe
- [font="Arial"][size="2"]..\..\bin\
- [font="Arial"][size="2"]Utilities.lib
[size="2"][font="Arial"][size="2"][subheading]Setting up the DLL's[/subheading]
[/font]
[size="2"]
[size="2"][font="Arial"][size="2"]I will explain how to setup one of the lib projects which links to an extern library. Properties for all the other projects can be set in the same way by looking at the dependencies from the previous tutorial
[/font][size="2"]
- [font="Arial"][size="2"]Create an Win 32 Project but change the Application Type to DLL and delete all the files except for stdafx.h, stdafx.cpp (For tutorial purposes we will be setting up the Utilities project)
- [font="Arial"][size="2"]Create a new folder called src and move the above files in there
- [font="Arial"][size="2"]For Both Release and Debug Modes
- [font="Arial"][size="2"]In the tab C/C++ -> General -> Additional Include Directories add
- [font="Arial"][size="2"]"Includes"
- [font="Arial"][size="2"]In the tab Linker -> General -> Output Directory add
- [font="Arial"][size="2"]..\..\Debug\
- [font="Arial"][size="2"]$(OutDir)/$(ProjectName)_D.dll
- [font="Arial"][size="2"]..\..\Debug\
- [font="Arial"][size="2"]Winmm.lib
- [font="Arial"][size="2"]In the tab Linker -> General -> Output Directory add
- [font="Arial"][size="2"]..\..\bin\
- [font="Arial"][size="2"]$(OutDir)/$(ProjectName).dll
- [font="Arial"][size="2"]..\..\bin\
- [font="Arial"][size="2"]tinyxml.lib
[size="2"][font="Arial"][size="2"]Notes:
[/font][size="2"]
- [font="Arial"][size="2"]To point to the directx dir we can use the visual studio macro $(DXSDK_DIR)\Include
[font="Arial"][size="2"][subheading]Final Thoughts[/subheading]
[/font]
[font="Arial"][size="2"]This finishes the initial setup. Since I am not sure, how much detail I should get into of why I setup my projects this way, I will be happy to answer any questions in the comments.
[/font][size="2"][font="Arial"][size="2"]The next tutorial will deal with the common includes, macros and how to make the debugger check for Memory Leaks
[/font]