want to build Open Cascade 6.7.0 in 64-bit system

I am a new user.Despite several attempts not to build Open Cascade 6.7.0 in 64-bit system with visual studio 2010.
need Step by step help.
Thanks in advance

Shamsher's picture

tried to build third party stuck with first step given at
http://www.opencascade.org/doc/occt-6.7.1/overview/html/occt_dev_guides_...

tried to run the solution file got the following error
"E:\ft253\freetype-2.5.3\builds\windows\vc2010\freetype.vcxproj : warning : Platform 'x64' referenced in the project file 'freetype' cannot be found. Please make sure you have it installed under '%VCTargetsPath%\Platforms\x64'."

Timo Roth's picture

You can find precompiled third party libraries here:
http://www.opencascade.org/getocc/download/3rdparty/

Shamsher's picture

Thanks Timo
I have downloaded all 3rd party libraries.Can you tell me what to do next.

Shamsher's picture

I am unable to download QT.

Timo Roth's picture

You don't need QT if you want to compile OCC.

Timo Roth's picture

Dear Forum supervisor,

the link to QT on the download page is invalid.

Regards

Forum supervisor's picture

Dear Timo,
The issue is fixed.
Thanks for the remark.
Best regards
FSR.

Shamsher's picture

Stuck with the following steps given at
http://www.opencascade.org/doc/occt-6.7.1/overview/html/occt_dev_guides_...

The building procedure

1.Unpack the downloaded archive of FreeType product into the 3rdparty folder. As a result, you will get a folder named, for example, 3rdparty\freetype-2.4.10. Further in this document, this folder is referred to as freetype.

2.Open the solution file freetype\builds\win32\vc20xx\freetype.sln in Visual Studio. Here vc20xx stands for your version of Visual Studio.

3.Select the configuration to build: either Debug or Release.

4.Build the freetype project.

As a result, you will get a freetype import library (.lib) in the freetype\obj\win32\vc20xx folder.

while running solution file from
C:\OCC_3rd_party\freetype-2.5.3\builds\windows\vc2010

Got the following error in solution

C:\OCC_3rd_party\freetype-2.5.3\builds\windows\vc2010\freetype.vcxproj : warning : Platform 'x64' referenced in the project file 'freetype' cannot be found. Please make sure you have it installed under '%VCTargetsPath%\Platforms\x64'.

Timo Roth's picture

You don't have to build the 3rd party components if you use the precompiled ones you downloaded. So, go on with Step 2 or 3 on http://www.opencascade.org/doc/occt-6.7.1/overview/html/occt_dev_guides_...

Shamsher's picture

this is my custom.bat file

@echo off

set VCVER=vc10
set ARCH=64
set "VCVARS=%VS10COMNTOOLS%..\..\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=%PRODUCTS_PATH%\opencl-icd-1.2.11.0-%ARCH%\include;%PRODUCTS_PATH%\tcltk-86-%ARCH%\include;%PRODUCTS_PATH%\freetype-2.4.11-%VCVER%-%ARCH%\include;%PRODUCTS_PATH%\freeimage-3.15.4-%VCVER%-%ARCH%\include;%PRODUCTS_PATH%\gl2ps-1.3.8-%VCVER%-%ARCH%\include;%PRODUCTS_PATH%\tbb30_018oss\include;%PRODUCTS_PATH%\qt462-%VCVER%-%ARCH%\include;%PRODUCTS_PATH%\qt462-%VCVER%-%ARCH%\include\Qt;%PRODUCTS_PATH%\qt462-%VCVER%-%ARCH%\include\QtGui;%PRODUCTS_PATH%\qt462-%VCVER%-%ARCH%\include\QtCore;%PRODUCTS_PATH%\jdk1.6.0-%ARCH%\include;%PRODUCTS_PATH%\jdk1.6.0-%ARCH%\include\win32"

rem Additional libraries (32-bit) search paths
set "CSF_OPT_LIB32=%PRODUCTS_PATH%\opencl-icd-1.2.11.0-32\lib;%PRODUCTS_PATH%\tcltk-86-32\lib;%PRODUCTS_PATH%\freetype-2.4.11-%VCVER%-32\lib;%PRODUCTS_PATH%\freeimage-3.15.4-%VCVER%-32\lib;%PRODUCTS_PATH%\gl2ps-1.3.8-%VCVER%-32\lib;%PRODUCTS_PATH%\tbb30_018oss\lib\ia32\%VCVER%;%PRODUCTS_PATH%\qt462-%VCVER%-32\lib"

rem Additional libraries (64-bit) search paths
set "CSF_OPT_LIB64=%PRODUCTS_PATH%\opencl-icd-1.2.11.0-64\lib;%PRODUCTS_PATH%\tcltk-86-64\lib;%PRODUCTS_PATH%\freetype-2.4.11-%VCVER%-64\lib;%PRODUCTS_PATH%\freeimage-3.15.4-%VCVER%-64\lib;%PRODUCTS_PATH%\gl2ps-1.3.8-%VCVER%-64\lib;%PRODUCTS_PATH%\tbb30_018oss\lib\intel64\%VCVER%;%PRODUCTS_PATH%\qt462-%VCVER%-64\lib"

rem Additional (32-bit) search paths
set "CSF_OPT_BIN32=%PRODUCTS_PATH%\opencl-icd-1.2.11.0-32\bin;%PRODUCTS_PATH%\tcltk-86-32\bin;%PRODUCTS_PATH%\freetype-2.4.11-%VCVER%-32\bin;%PRODUCTS_PATH%\freeimage-3.15.4-%VCVER%-32\bin;%PRODUCTS_PATH%\gl2ps-1.3.8-%VCVER%-32\bin;%PRODUCTS_PATH%\tbb30_018oss\bin\ia32\%VCVER%;%PRODUCTS_PATH%\qt462-%VCVER%-32\bin;%PRODUCTS_PATH%\jdk1.6.0-32\bin"

rem Additional (64-bit) search paths
set "CSF_OPT_BIN64=%PRODUCTS_PATH%\opencl-icd-1.2.11.0-64\bin;%PRODUCTS_PATH%\tcltk-86-64\bin;%PRODUCTS_PATH%\freetype-2.4.11-%VCVER%-64\bin;%PRODUCTS_PATH%\freeimage-3.15.4-%VCVER%-64\bin;%PRODUCTS_PATH%\gl2ps-1.3.8-%VCVER%-64\bin;%PRODUCTS_PATH%\tbb30_018oss\bin\intel64\%VCVER%;%PRODUCTS_PATH%\qt462-%VCVER%-64\bin;%PRODUCTS_PATH%\jdk1.6.0-64\bin"

& this is my env.bat file

@echo off

rem Use:
rem - first argument specifies version of Visual Studio (vc8, vc9, vc10, vc12 or vc13),
rem - second argument specifies architecture (win32 or win64),
rem - third argument specifies build mode (Debug or Release)
rem Default options are:
rem vc9 win32 Release

set "SCRIPTROOT=%~dp0"
set "SCRIPTROOT=%SCRIPTROOT:~0,-1%"
set "CASROOT=%SCRIPTROOT%"
if not ["%CASROOT%"] == [""] if exist "%SCRIPTROOT%\%CASROOT%" set "CASROOT=%SCRIPTROOT%\%CASROOT%"
if ["%CASROOT%"] == [""] set "CASROOT=%SCRIPTROOT%"

rem ----- Reset values to defaults -----
set "CASDEB="
set "VCVER=vc10"
set "ARCH=64"
set "VCVARS="
set "HAVE_TBB=false"
set "HAVE_OPENCL=false"
set "HAVE_FREEIMAGE=false"
set "HAVE_GL2PS=false"
set "HAVE_OPENCL=false"
set "CSF_OPT_INC="
set "CSF_OPT_LIB32="
set "CSF_OPT_LIB64="
set "CSF_OPT_BIN32="
set "CSF_OPT_BIN64="

rem ----- Load local settings -----
if exist "%~dp0custom.bat" (
call "%~dp0custom.bat" %1 %2 %3 %4 %5
)

rem ----- Read script arguments (override local settings) -----
if not ["%1"] == [""] set "VCVER=%1"
if not ["%2"] == [""] set "ARCH=%2"
if /I ["%ARCH%"] == ["win32"] set "ARCH=32"
if /I ["%ARCH%"] == ["win64"] set "ARCH=64"
if /I ["%3"] == ["debug"] set "CASDEB=d"
if /I ["%3"] == ["d"] set "CASDEB=d"

set "CSF_OPT_INC=%CSF_OPT_INC%;%CASROOT%\inc"
set "CSF_OPT_LIB32D=%CSF_OPT_LIB32%;%CASROOT%\win32\%VCVER%\libd"
set "CSF_OPT_LIB64D=%CSF_OPT_LIB64%;%CASROOT%\win64\%VCVER%\libd"
set "CSF_OPT_BIN32D=%CSF_OPT_BIN32%;%CASROOT%\win32\%VCVER%\bind"
set "CSF_OPT_BIN64D=%CSF_OPT_BIN64%;%CASROOT%\win64\%VCVER%\bind"
set "CSF_OPT_LIB32=%CSF_OPT_LIB32%;%CASROOT%\win32\%VCVER%\lib"
set "CSF_OPT_LIB64=%CSF_OPT_LIB64%;%CASROOT%\win64\%VCVER%\lib"
set "CSF_OPT_BIN32=%CSF_OPT_BIN32%;%CASROOT%\win32\%VCVER%\bin"
set "CSF_OPT_BIN64=%CSF_OPT_BIN64%;%CASROOT%\win64\%VCVER%\bin"

rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
set "CSF_OPT_CMPL="
set "PRODUCTS_DEFINES="
if ["%HAVE_TBB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_TBB"
if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_OPENCL"
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
if ["%HAVE_TBB%"] == ["true"] set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
if ["%HAVE_OPENCL%"] == ["true"] set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
if ["%HAVE_GL2PS%"] == ["true"] set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"

rem Eliminate VS warning
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"

rem ----- Optional 3rd-parties should be enabled by HAVE macros -----
if not ["%PRODUCTS_DEFINES%"] == [""] set "CSF_OPT_CMPL=%CSF_OPT_CMPL% %PRODUCTS_DEFINES%"

rem ----- Colect 3rd-parties additional include paths into compiler options -----
for %%a in ("%CSF_OPT_INC:;=";"%") do (
set "anItem=%%~a"
if not ["%%~a"] == [""] call :concatCmplInc %%~a
)

rem ----- Colect 3rd-parties additional library paths (32-bit) into linker options -----
set "OPT_LIB32="
for %%a in ("%CSF_OPT_LIB32:;=";"%") do (
set "anItem=%%~a"
if not ["%%~a"] == [""] call :concatLib32 %%~a
)

rem ----- Colect 3rd-parties additional library paths (64-bit) into linker options -----
set "OPT_LIB64="
for %%a in ("%CSF_OPT_LIB64:;=";"%") do (
set "anItem=%%~a"
if not ["%%~a"] == [""] call :concatLib64 %%~a
)

set "CSF_OPT_LNK32="
set "CSF_OPT_LNK64="
set "CSF_OPT_LNK32D="
set "CSF_OPT_LNK64D="
set "CSF_OPT_LNK32=%CSF_OPT_LNK32% %OPT_LIB32%"
set "CSF_OPT_LNK32D=%CSF_OPT_LNK32D% %OPT_LIB32%"
set "CSF_OPT_LNK64=%CSF_OPT_LNK64% %OPT_LIB64%"
set "CSF_OPT_LNK64D=%CSF_OPT_LNK64D% %OPT_LIB64%"

set "CASBIN=win%ARCH%\%VCVER%"

rem ----- Set path to 3rd party and OCCT libraries -----
set "PATH=%SCRIPTROOT%\%CASBIN%\bin%CASDEB%;%PATH%"
if ["%CASDEB%"] == [""] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32%;%PATH%"
if ["%CASDEB%"] == [""] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64%;%PATH%"
if not ["%CASDEB%"] == [""] if ["%ARCH%"] == ["32"] set "PATH=%CSF_OPT_BIN32D%;%PATH%"
if not ["%CASDEB%"] == [""] if ["%ARCH%"] == ["64"] set "PATH=%CSF_OPT_BIN64D%;%PATH%"

rem ----- Set envoronment variables used by OCCT -----
set CSF_LANGUAGE=us
set MMGT_CLEAR=1
set CSF_EXCEPTION_PROMPT=1
set "CSF_SHMessage=%CASROOT%\src\SHMessage"
set "CSF_MDTVTexturesDirectory=%CASROOT%\src\Textures"
set "CSF_ShadersDirectory=%CASROOT%\src\Shaders"
set "CSF_XSMessage=%CASROOT%\src\XSMessage"
set "CSF_TObjMessage=%CASROOT%\src\TObj"
set "CSF_StandardDefaults=%CASROOT%\src\StdResource"
set "CSF_PluginDefaults=%CASROOT%\src\StdResource"
set "CSF_XCAFDefaults=%CASROOT%\src\StdResource"
set "CSF_TObjDefaults=%CASROOT%\src\StdResource"
set "CSF_StandardLiteDefaults=%CASROOT%\src\StdResource"
set "CSF_GraphicShr=TKOpenGl.dll"
set "CSF_UnitsLexicon=%CASROOT%\src\UnitsAPI\Lexi_Expr.dat"
set "CSF_UnitsDefinition=%CASROOT%\src\UnitsAPI\Units.dat"
set "CSF_IGESDefaults=%CASROOT%\src\XSTEPResource"
set "CSF_STEPDefaults=%CASROOT%\src\XSTEPResource"
set "CSF_XmlOcafResource=%CASROOT%\src\XmlOcafResource"
set "CSF_MIGRATION_TYPES=%CASROOT%\src\StdResource\MigrationSheet.txt"

rem Draw Harness special stuff
if exist "%CASROOT%\src\DrawResources" (
set "DRAWHOME=%CASROOT%\src\DrawResources"
set "CSF_DrawPluginDefaults=%DRAWHOME%"
)
if exist "%SCRIPTROOT%\src\DrawResourcesProducts" (
set "CSF_DrawPluginProductsDefaults=%SCRIPTROOT%\src\DrawResourcesProducts"
)
goto :eof

:concatCmplInc
set "CSF_OPT_CMPL=%CSF_OPT_CMPL% -I%1"
goto :eof

:concatLib32
set "OPT_LIB32=%OPT_LIB32% /LIBPATH:%1"
goto :eof

:concatLib64
set "OPT_LIB64=%OPT_LIB64% /LIBPATH:%1"
goto :eof

now when I try to run msvc.bat
it gives the following error
could not find MS visual studio
check relevant environment variable

Timo Roth's picture

Try changing the following line of custom.bat:

set "VCVARS=%VS10COMNTOOLS%..\..\VC\vcvarsall.bat"

to:

set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"

Shamsher's picture

not helping still getting the same error

Timo Roth's picture

As it says in the error message, check your environment variables. Which environment variables are defined starting with "VS"?

Shamsher's picture

where to check those

Timo Roth's picture

Please, use a search engine to get answers to such basic questions.

In Windows Command-Prompt, to get a list of all environment variables enter the command: set

Shamsher's picture

Got that it is
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\

please can u suggest that what I need to change in this.

Thanks again

Timo Roth's picture

You don't have to change it.
See msvc.bat for what it does and where the error comes from.
It cannot find "%DevEnvDir%\devenv.exe".
See what is the value of environment variable DevEnvDir and why the executable cannot be found.

Shamsher's picture

Sorry to bother again but I am from mechanical domain so can't help it.
Here is msvc.bat file if u can help.

@echo off

rem Setup environment
call "%~dp0env.bat" %1 %2 %3

rem Define path to project file
set "PRJFILE=%~dp0\adm\msvc\%VCVER%\OCCT.sln"
if not exist "%PRJFILE%" set "PRJFILE=%~dp0\adm\msvc\%VCVER%\Products.sln"
if not "%4" == "" (
set "PRJFILE=%4"
)

set "VisualStudioExpressName=VCExpress"

if "%VCVER%" == "vc10" (
set "DevEnvDir=%VS80COMNTOOLS%..\IDE"
) else if "%VCVER%" == "vc9" (
set "DevEnvDir=%VS90COMNTOOLS%..\IDE"
) else if "%VCVER%" == "vc10" (
set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
) else if "%VCVER%" == "vc11" (
set "DevEnvDir=%VS110COMNTOOLS%..\IDE"
rem Visual Studio Express starting from VS 2012 is called "for Windows Desktop"
rem and has a new name for executable - WDExpress
set "VisualStudioExpressName=WDExpress"
) else if "%VCVER%" == "vc12" (
set "DevEnvDir=%VS120COMNTOOLS%..\IDE"
set "VisualStudioExpressName=WDExpress"
) else (
echo Error: wrong VS identifier
exit /B
)

rem Launch Visual Studio - either professional (devenv) or Express, as available
if exist "%DevEnvDir%\devenv.exe" (
start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
) else (
echo Error: Could not find MS Visual Studio ^(%VCVER%^)
echo Check relevant environment variable ^(e.g. VS80COMNTOOLS for vc8^)
)

pause

Shamsher's picture

And also no environment variable DevEnvDir exists.
Do I need to create a new one And if so what should be the value.

Timo Roth's picture

After running msvc.bat in the console, there should exist an environment variable DevEnvDir in this console. Check its value.

Shamsher's picture

Hi Timo,
can you just go through following link
https://connect.microsoft.com/VisualStudio/feedback/details/368734/-deve...

In comment section on this page it is given

MRK,

I also dug a little deeper into this bug. The problem is that the targets file used by Visual Studio defines DevEnvDir with a backslash, but the Visual Studio command prompt defines it without the trailing backslash.

When running from VS, the targets file sets up the environment. When running from the VS Command Prompt, the Environment Variables are passed in.

To change the variable for the VS Command Prompt is the simplest. Go to your VS install directory in the path .\Common7\Tools\ and edit the file vsvars32.bat. Of course, you will need to do this for all machines that you are going to build on.

Now I have opened vsvars32.bat. file but what to edit in that.

Thanks

Timo Roth's picture

You don't have to change vsvars32.bat.

- Open a windows console, go to the directory where occ is installed
- In the console run: msvc.bat
- In the console run: set de
=> On my machine it prints:
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\..\I
DE

What does it print on your machine?
Does this directory exist?
Is Visual Studio 2010 installed?

Shamsher's picture

hi Timo
set de is fine

but msvc.bat giving the same error

could not find MS visual studio
check relevant environment variable

otherwise visual studio is working fine and running properly in my system.

Timo Roth's picture

Does C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe exist?

Shamsher's picture

Hi Timo

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
does not exist.

What to do next ?

Thanks in Advance

Timo Roth's picture

Search for devenv.exe in C:\Program Files (x86)

Shamsher's picture

No such file is there.
what we need to do now ?

Shamsher's picture

i checked on google
http://stackoverflow.com/questions/9778593/vs2010-express-missing-devenv...

the following answeris given

The name of the executable (and, of course, the associated configuration file) is dependent upon which type of Visual Studio you're running. Normally, this is devenv.exe. In the case of Visual Studio Express, you should be able to locate vcexpress.exe.

A similar configuration file is available as vcexpress.exe.config, and you should be able to place your system.diagnostics configuration in that file.

vcexpress.exe is there and vcexpress.exe.config is also there

Timo Roth's picture

After running msvc.exe in a console, check the value of the environment variables.
Enter:
echo %VisualStudioExpressName%
echo %PRJFILE%
What is the result?

Try to start VisualStudio from the command line, using:
start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"

Shamsher's picture

It gives the following error
msvc.exe is not recognized as internal or external command
operable program or batch file

Timo Roth's picture

Sorry, I meant msvc.bat.

Shamsher's picture

Timo thanks for your patience and help

I think it will be better if I install visual studio 2008

can you send me the link where I can download visual studio 2008 for windows 8 64 bit system.

once again thanks