Preparing Microsoft Visual C++ 6.0 for the CCC library
- Select the Tools|Options menu option from the main menu
of the Developer Studio
- Click on the Directories tab.
- Make sure the Platform choice is set to Win32 and the Show
directories for choice is set for Include files.
- Double-click on the empty rectangle at the bottom of the Directories
list.
- Type the location of your CCC files, such as c:\CCCBook\cccfiles,
or click on the ... icon and choose the directory. (This must
be the directory that contains ccc_ansi.cpp and so on.)
Creating a project with Microsoft Visual C++ 6.0
- Select the File | New ... menu option from the main menu
of the Developer Studio
- Now you need to make your first decision. Are you building a console
application or a graphics application? A console
application reads keystrokes and displays text in a console window (or
"DOS window), typically with a black background. For example, the "Hello,
World" program is a console application. A graphical application
displays graphical shapes in a regular window, with a white background.
- For a console application, select Win32 Console
Application from the dialog.
- For a graphical application, select Win32 Application
from the dialog.
- In the same dialog, in the Project Name field, enter a
name for your project (such as MyProject).
- Still in the same dialog, in the Location field, select
the working directory for your files (such as c:\MyHomework).
You can click on the ... icon to pick a directory, or you can
type in the full path name.
Warning: If you pick the directory by clicking on the ...
dialog, the compiler doesn't place the files into the directory that
you picked. Instead, it places them in a subdirectory with the same
name as the project (for example, c:\MyHomework\MyProject).
- Still in the same dialog, click Ok.
- In the resulting dialog box, Select An empty project and
click Finish
- In the resulting "Project Information" dialog, click Ok
- Now you need to make another decision. Do you want to start with
a new file, or do you want to compile an existing file (say, one of the
examples).
- To start with a new file:
- Select the Project | Add to project | New ...
menu option from the main menu of the Developer Studio
- In the resulting dialog box, select C++ Source file.
- In the same dialog, in the File name field, enter
a name for your source file (such as MyProject.cpp).
- Double-check that the path in the Location field
is correct.
- Click Ok.
- You get a new file into which you can type your program.
- To compile an existing file:
- Select the Project | Add to project | Files ...
menu option from the main menu of the Developer Studio
- In the resulting file chooser dialog, pick the source
file you want.
- Click Ok.
- To actually see the contents of the file, click on the
tab labeled File view on the left hand side of the screen.
- Then expand the files in your project by clicking on the +
icon in the tree in the file view panel.
- Click on the + next to Source files
- You should now see the file that you added. Double-click
on the file name.
- When you are ready to build your program, select theBuild |
Build menu option from the main menu of the Developer Studio.
- If there are error messages in the bottom window, double-click on
each message to go to the location of the error in your file. Fix the
errors and build your program again.
- When your program has been built succesfully, select theBuild
| Execute menu option from the main menu of the Developer Studio.
- If you need to debug your program, select theBuild | Start
Debug | Step Into menu option from the main menu of the Developer
Studio.
- If you want to start a new project, select theFile | Close
workspacemenu option from the main menu of the Developer Studio.