Computing Concepts with C++ Essentials/Big C++

Compiler and Tool Help

Visual C++.NET (7.0)

Compiling a simple program from the book

  1. Start Visual C++.NET
  2. Select File -> New -> Project



  3. In the resulting dialog, select "Win32 Console Project". Then type in the name for your project (such as Hello) and a location (such as. c:\yourname\CS101). Click Ok.



  4. In the "wizard" dialog, click on the Application Settings tab. Check the Empty Project check box.



  5. Select File->Add Existing Item... from the menu and select the file from the book code that you want to add to your project (such as hello.cpp).



  6. In the Solution Explorer window, click on the file you want to view or edit.



  7. To compile, choose the menu option Build -> Build Solution.
  8. To run your program, choose the menu option Debug -> Start without Debugging

Compiling programs that use the Employee and Time classes

  1. Start a project as described in steps 1 through 5 of the basic instructions.
  2. In addition to the file that you want to compile (such as employee.cpp), repeat the File->Add Existing Item... menu option to add ccc_empl.cpp from the cccfiles directory (or ccc_time.cpp for programs that use the Time class).
  3. Select the menu option Project -> (name of project) Properties. In the resulting dialog, select Configuration Properties : C/C++ : General. In the Additional Include Directories field, type in the full path to the cccfiles directory (such as c:\yourname\bigcpp\cccfiles). Click Ok.



  4. To compile, choose the menu option Build -> Build Solution.
  5. To run your program, choose the menu option Debug -> Start without Debugging.

Compiling graphics programs

  1. Select File -> New -> Project
  2. Select Win32 project and specify the name and directory for your project.



  3. In the "wizard" dialog, click on the Application Settings tab, check the Empty Project check box.
  4. Select File->Add Existing Item... from the menu and select the file from the book code that you want to add to your project (such as circle.cpp).
  5. Repeat the File->Add Existing Item... menu option twice, to add ccc_msw.cpp and ccc_shap.cpp from the cccfiles directory.
  6. Select the menu option Project -> (name of project) Properties. In the resulting dialog, select Configuration Properties : C/C++ : General. In the Additional Include Directories field, type in the full path to the cccfiles directory (such as c:\yourname\bigcpp\cccfiles). Click Ok.
  7. To compile, choose the menu option Build -> Build Solution.



  8. To run your program, choose the menu option Debug -> Start without Debugging.



Compiling wxWidgets programs

Note that the wxWindows library has changed the name to wxWidgets, but the current stable version (2.4.2) still uses the wxWindows name.

You need to carry out the following steps once.
  1. Download the Windows version of the library. Pick the file wxMSW-2.4.2.zip, save it to your computer and extract it into the root directory. You should now have a c:\wxWindows-2.4.2 directory.
  2. Open a DOS shell. (Start -> Run, type cmd, and click Ok).
  3. Type the following commands:
    set WXWIN=c:\wxWindows-2.4.2
    "c:\Program Files\Microsoft Visual Studio .NET 2003\vc7\bin\vcvars32.bat"
    c:
    cd \wxWindows-2.4.2\src\msw
    nmake -f makefile.vc
    (You may need to adjust the directory of vcvars32.bat if you did not choose the default location for Visual Studio.)
  4. Wait until nmake is finished. To confirm that all is well, check that the file c:\wxWindows-2.4.2\lib\wxmswd.lib has been created.
For each program, you need to carry out the following steps:
  1. Start Visual Studio
  2. Select File -> New -> Project
  3. Select Win32 project and specify the name and directory for your project.
  4. Select the menu option Project -> (name of project) Properties. In the resulting dialog, select Configuration Properties : C/C++ : General. In the Additional Include Directories field, type in
    C:\wxWindows-2.4.2\include;C:\wxWindows-2.4.2\lib\mswd
    (two paths, separated by a semicolon)



  5. Still in the project properties dialog, select Configuration Properties : Linker : General. In the Additional Library Directories field, enter
    C:\wxWindows-2.4.2\lib


  6. Still in the project properties dialog, select Configuration Properties : Linker : Input. In the Additional Dependencies field, enter
    wxmswd.lib wsock32.lib comctl32.lib rpcrt4.lib

    (four libraries, separated by spaces)


  7. To compile, choose the menu option Build -> Build Solution.
  8. To run your program, choose the menu option Debug -> Start without Debugging.