Project structure We recommend that you create your buffer manager project as follows. Create a
directory, e.g., z:\cs432\A1. Assume
the skeleton code is copied to the following two directories :
z:\cs432\A1\globaldefs\*.[Ch]
<=== Contains all the source code files needed to make the static library "globaldefs.lib".
z:\cs432\A1\code\*.[Ch]
<=== Contains all the source code files for the buffer manager.
Inside Visual C++ (Version 6.0 as installed in the
undergraduate lab):
Create a "Win32 Console Application" (we call ours
"BufferManager") in the location "z:\cs432\A1
":
- Go to File menu click on New.
- In the menu that pops out, you must select "Win32 Console
Application" (we named ours "BufferManager").
- In the window that asks you for the type of project to be created, select
"An empty project"
- Now our workspace is created.
Create a "Win32 Static Library" (we call ours "globaldefs")
and add it to current workspace making it
a dependency of "BufferManager":
- Go to File menu click on New
- In the menu that pops out, you must select "Projects" and then
select "Win32 Static Library", add it to current workspace and
make it a dependency of "BufferManager". (We named our Static Library
"globaldefs".)
- In the next window, do not select pre-compiled header nor MFC support,
just click "Finish"
Adding files to projects "BufferManager" and "globaldefs".
- Go to the Project menu, set the active workspace to project globaldefs.
- Go to the Project menu, click on "Add to Project" and then
"Files".
- Add all the source files in z:\cs432\A1\globaldefs
to project globaldefs.
- Set the active workspace to project BufferManager.
- Add all the source files in z:\cs432\A1\code
to project BufferManager.
You must change the settings for projects BufferManager and globaldefs
to include the directories where the header files are located. For example, the
project globaldefs needs to include the header file "bufmgr.h", which
is located in the directory code. Add flag
"/Iz:\cs432\A1\BufferManager" to the Project option
of "globaldefs". This can be done as following:
- Go to Project Menu click on Settings.
- Select the project globaldefs on the left hand side of the window.
- Click on the C/C++ tab. (Make sure that you have still project globaldefs
selected.)
- Add the flag "/Iz:\cs432\A1\code" (without the quotes) to the Project Options.
(The Projects Options is the bottommost window that contains other options such as /nologo etc.).
- Repeat procedure but this time add the directory "/Iz:\cs432\A1\globaldefs"
(without the quotes) to the Project Options of BufferManager.
Now you are ready to change the code
and build the application. You can start coding by opening the bufmgr.cpp file in your
project. If you don't know how to do any steps explained above, the fastest
approach is to either check the Visual C++ online help, ask your neighbor in the
lab how to set up the project, or send email to the TAs or the instructor.