Open CASCADE Technology  7.0.0
Building with MS Visual C++

General

This page describes steps to build OCCT libraries from a complete source archive on Windows with MS Visual C++ using projects generated by genproj tool. It is an alternative to use of CMake build system (see Building with CMake).

genproj is a legacy tool (originated from command "wgenproj" in WOK) for generation of Visual Studio, Code.Blocks, and XCode project files used for building Open CASCADE Technology. These project files are placed inside OCCT directory (in adm subfolder) and use relative paths, thus can be moved together with sources.

The project files included in official distribution of OCCT are generated by this tool. If you have official distribution with project files included, you can use them directly without a need to call genproj.

Third-party libraries

Before building OCCT, make sure to have all the required third-party libraries installed.

The easiest way to install third-party libraries is to download archive with pre-built binaries, corresponding to version of Visual Studio you are using, from http://www.opencascade.com/content/3rd-party-components.

You can also build third-party libraries from their sources, see Building 3rd-party libraries on Windows for instructions.

Configuration

If you have Visual Studio projects already available (pre-installed or generated), you can edit file custom.bat manually to adjust the environment:

  • VCVER – version of Visual Studio (vc10, vc11, vc12, or vc14), and relevant VCVARS path
  • ARCH – architecture (32 or 64), affects only PATH variable for execution
  • HAVE_* – flags to enable or disable use of optional third-party products
  • CSF_OPT_* – paths to search for includes and binaries of all used third-party products
  • SHORTCUT_HEADERS – if set to "true", folder inc will be populated by short-cut files pointing to actual headers located in src; otherwise, header files will be copied to inc.

Alternatively, you can launch genconf, a GUI tool allowing to configure build options interactively. That tool will analyze your environment and propose you to choose available options:

  • Version of Visual Studio to be used (from the list of installed ones, detected by presence of environment variables like VS100COMNTOOLS)
  • Option to use short-cuts to header files in folder inc (enabled by default).
  • Location of third-party libraries (usually downloaded from OCCT web site, see above).
  • Path to common directory where third-party libraries are located (optional)
  • Paths to headers and binaries of the third-party libraries (found automatically basing on previous options; click button "Reset" to update).
genconf_windows.png

Click "Save" to store the specified configuration in custom.bat file.

Projects generation

Launch genproj to update content of inc folder and generate project files after changes in OCCT code affecting layout or composition of source files.

Note
To use genproj and genconf tools you need to have Tcl installed and accessible by PATH. If Tcl is not found, the tool may prompt you to enter the path to directory where Tcl can be found.
1 $ genproj.bat

Note that if custom.bat is not present, genproj will start genconf to configure environment.

Building

Launch msvc.bat to start Visual Studio with all necessary environment variables defined, and build the whole solution or required toolkits.

Note: the MSVC project files are located in folders adm\msvc\vc.... Binaries are produced in win32 or win64 folders.

To start DRAW, launch draw.bat.