我的安装环境:

Windows7 旗舰版 SP1 x64;


Visual Studio 2013;


OpenCasCade-6.8.0 源码包;



OpenCasCade下载和安装

​http://www.opencascade.org/getocc/download/loadocc/ ​


解压后如下图:



接下来,下载适合自己编译器版本的第三方库:


下载后如下图所示:



使用Visual Studio建立OCCT

1. 编辑脚本文件  custom.bat  来 定义你的环境:

@echo off

set VCVER=vc12
set ARCH=32
set "VCVARS=%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
set "PRODUCTS_PATH=%~dp0.."

rem Optional 3rd-parties switches
set HAVE_FREEIMAGE=true
set HAVE_GL2PS=true
set HAVE_TBB=true
set HAVE_OPENCL=true
set CHECK_QT4=true
set CHECK_JDK=true

rem Additional headers search paths
set "CSF_OPT_INC=D:\Program Files\OpenCASCADE6.8.0\opencl-icd-1.2.11.0-32\include;D:\Program Files\OpenCASCADE6.8.0\tcltk-86-32\include;D:\Program Files\OpenCASCADE6.8.0\freetype-2.4.11-vc12-32\include;D:\Program Files\OpenCASCADE6.8.0\freetype-2.4.11-vc12-32\include\freetype;D:\Program Files\OpenCASCADE6.8.0\freeimage-3.16.0-vc12-32\include;D:\Program Files\OpenCASCADE6.8.0\gl2ps-1.3.8-vc12-32\include;D:\Program Files\OpenCASCADE6.8.0\tbb43_20150424oss\include;D:\Program Files\OpenCASCADE6.8.0\VTK-6.1.0-vc12-32\include\vtk-6.1;D:\Program Files\OpenCASCADE6.8.0\opencascade-6.8.0\inc"

rem Additional libraries (32-bit) search paths
set "CSF_OPT_LIB32=D:\Program Files\OpenCASCADE6.8.0\opencl-icd-1.2.11.0-32\lib;D:\Program Files\OpenCASCADE6.8.0\tcltk-86-32\lib;D:\Program Files\OpenCASCADE6.8.0\freetype-2.4.11-vc12-32\lib;D:\Program Files\OpenCASCADE6.8.0\freeimage-3.16.0-vc12-32\lib;D:\Program Files\OpenCASCADE6.8.0\gl2ps-1.3.8-vc12-32\lib;D:\Program Files\OpenCASCADE6.8.0\tbb43_20150424oss\lib\ia32\%VCVER%;D:\Program Files\OpenCASCADE6.8.0\VTK-6.1.0-vc12-32\lib"

rem Additional libraries (64-bit) search paths
set "CSF_OPT_LIB64=D:\Program Files\OpenCASCADE6.8.0\opencl-icd-1.2.11.0-32\lib;D:\Program Files\OpenCASCADE6.8.0\tcltk-86-32\lib;D:\Program Files\OpenCASCADE6.8.0\freetype-2.4.11-vc12-32\lib;D:\Program Files\OpenCASCADE6.8.0\freeimage-3.16.0-vc12-32\lib;D:\Program Files\OpenCASCADE6.8.0\gl2ps-1.3.8-vc12-32\lib;D:\Program Files\OpenCASCADE6.8.0\tbb43_20150424oss\lib\intel64\%VCVER%;D:\Program Files\OpenCASCADE6.8.0\VTK-6.1.0-vc12-32\lib"

rem Additional (32-bit) search paths
set "CSF_OPT_BIN32=D:\Program Files\OpenCASCADE6.8.0\opencl-icd-1.2.11.0-32\bin;D:\Program Files\OpenCASCADE6.8.0\tcltk-86-32\bin;D:\Program Files\OpenCASCADE6.8.0\freetype-2.4.11-vc12-32\bin;D:\Program Files\OpenCASCADE6.8.0\freeimage-3.16.0-vc12-32\bin;D:\Program Files\OpenCASCADE6.8.0\gl2ps-1.3.8-vc12-32\bin;D:\Program Files\OpenCASCADE6.8.0\tbb43_20150424oss\bin\ia32\%VCVER%;D:\Program Files\OpenCASCADE6.8.0\VTK-6.1.0-vc12-32\bin"

rem Additional (64-bit) search paths
set "CSF_OPT_BIN64=D:\Program Files\OpenCASCADE6.8.0\opencl-icd-1.2.11.0-32\bin;D:\Program Files\OpenCASCADE6.8.0\tcltk-86-32\bin;D:\Program Files\OpenCASCADE6.8.0\freetype-2.4.11-vc12-32\bin;D:\Program Files\OpenCASCADE6.8.0\freeimage-3.16.0-vc12-32\bin;D:\Program Files\OpenCASCADE6.8.0\gl2ps-1.3.8-vc12-32\bin;D:\Program Files\OpenCASCADE6.8.0\tbb43_20150424oss\bin\intel64\%VCVER%;D:\Program Files\OpenCASCADE6.8.0\VTK-6.1.0-vc12-32\bin"


2. 接着运行  msvc.bat  脚本文件开始运行 Visual Studio。

3.编译链接通过后,最后运行draw.bat脚本文件,你就可以看到示例窗口了!