Making a Visual C++ 6.0 project for the Improv library

  1. know where the include directory for the source files is located, e.g.: c:\user\craig\improv\include
    This directory contains all of the necessary header files for the library.

  2. know where the source directory is located, e.g.: c:\user\craig\improv\src
    This directory contains all of the necesary source files which will be compiled into a single library file.

  3. know where you want the library file to go, e.g.: c:\user\craig\improv\lib\improv.lib
    This is the file which will be made ultimately by the project. It is used to compile programs by linking to the library which will find the compiled definition of functions needed in the programs.

  1. open Visual C++ version 6.0

  2. Create a project for a static library

    menu: file --> New --> tab: Projects --> "Win 32 Static Library"

    Location: put a directory location for the workspace here.

    Project name: fill in with a name for the project.

    button:ok, button:finish, button:ok.

  3. Set the compilation output to release.

    Menu: Build --> Set Active Configuration... --> "Win 32 Release" --> Ok.

  4. Add compiler definition and include path

    Projects --> Settings... --> Tab: C/C++ ---> Project options:

    in project options, add these lines:

    		/D"VISUAL"
    		/I"C:\user\craig\improv\include"
    

    /D"VISUAL" defines the preprocessor variable so that the compiler know it is supposed to include Visual C++ sections of library code. /I"C:\user\craig\improv\include" tells the compiler where the include files for the code exists. Put in the appropriate directory name here.

    (Button: OK )

  5. Add source code to project:

    Menu: Project --> Add to Project --> Files... --> Find...

    Add all .h and .cpp files in the source directory.

  6. Optionally add include files into project:

    Menu: Project --> Add to Project --> Files... --> Find...

    Add all .h files in the include directory.

  7. build the library (which will be called for example: c:\user\craig\lib\improv.lib) menu: build --> F7

    The default library location is in ...Release/projectname.lib

    To compile source files one at a time, you can press control-F7 after highlighting each source file.

  8. The library should now be created and ready to use.










craig@ccrma.stanford.edu