CONTENTS
Directory Structure
----- Unix Directory Structure
----- NT Directory Structure
Include Conventions
Source Control
Visual C++ 4.0 Workspaces
----- The first time you run VC++ 4.0
----- Setting up a new workspace
Not yet written.
Project
|
+--+--Workspace
| |
| +--proj1
| | +--Debug
| | +--Release
| | +--TTY Debug
| |
| +--proj2
| | +--Debug
| | +--Release
| | +--TTY Debug
| |
| +--proj3
| | ...
| ...
|
+--src
| |
| +--proj1
| | +--res
| | +--doc
| |
| +--proj2
| | +--proj3
| |
| ...
|
+--lib
Sources and header files are to be placed in the src\project directory. Resource files, if any, should be placed in a directory right below this called res. This does not include rc files, which should join .c and .h files in the src\project directory.
Workspace files should go in the Workspace\project library. All library files will be placed in the lib directory.
Includes should be as follows:
#include <proj/header.h>
As a temporary measeure, some include statements have been written as
#include "../proj/header.h"
but this is being phased out. Conversion to the new conventions should not harm anything. You must first have set up your Makefile or VC++ correctly in order for this to work.
The first time you run VC++ 4.0
The first time a new copy of VC++ 4.0 is run (and this might mean the first time and individual _user_ is running it...) there are a few options that need to be set.
Select "Tools"/"Options...". Then choose the "Directories" tab. Check and make sure that all of the directories in all four categories do not have references to the CD-ROM (D: on most of these machines). Delete any that do. In the include files, make sure the following two entries exist:
C:\GSW4\C\INCLUDE
C:\Project\src
In the library files section, make sure the following two directory entries exist:
C:\GSW4\C\LIB
C:\Project\lib
Make sure that you use the proper drive letter, as it may not necessarily be C.
The first thing you want to do is set up a source directory. You do this by deciding on a name for the project, and then creating a directory by that name under the src tree in the Project directory. You can then copy any relevant .c and .h files into that directory. Make sure you change and .c files to .cpp files. This can be done at the DOS prompt by typing
ren *.c *.cpp
If you are creating a library or executable which should have a TTY debug mode, you need to set up a TTY Debug configuration. Select "Build"/"Configurations...". Click on "Add", and type "TTY Debug". Be sure to base this configuration off of the Debug configuration. If you save this step until after the settings below are done, you will not have to change as much in the settings.
Once you have don this, you are ready to start setting up a project. Start up Microsoft Developer Wizard. Go to "File"/"New..", and select "Project Workspace". Make sure the Location is the path to the Project/Workspace directory. Type in the name of your project (the same as you named your source directory) in the Name box. If you are making a library, choose the type "Static Library". If you are making an executable, you will probably want to choose "MFC AppWizard(exe)". The dialog boxes which result from that, however, are beyond the scope of this document.
Once you are through that, you are ready to start playing with the project settings. Choose "Build"/"Settings...". Choose the "C/C++" tab. Select "Code generation" from the combo box. Make sure the run-time library is "Multithreaded" for the release configuration, and "Debug Multithreaded" for the Debug configuration. Select "General" from the combo-box. To the Release and Debug version, add PC_MVIS_PLATFORM to the preprocessor definitions. Add PC_TTY_PLATFORM to the TTY Debug version.
Choose the link tab if you are using an executable. In the Libraries box, you should have a list of libraries which your executable uses. The Release version should use files of the form proj.lib, the Debug version should use files of the form projD.lib, and the TTY Debug version should use files of the form projT.lib.
Choose the library tab if you are creating a library. The output filename should be ../../lib/proj.lib for the release, ../../lib/projD.lib for the debug version, and ../../lib/projT.lib for the TTY debug version.
Choose the Browse Info tag. Select Build Browse Infor for all configurations.
And that should do it. All you need to do now is "Insert files into project". Make sure you insert all .cpp and .rc files. Do not insert .h files.