For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Compiling the 64bit version using VS2008 cross compiler

Pawel's picture


I noticed there is a problem with the 3rd party libraries (TBB, FreeImage, gl2ps) when compiling OCCT 6.5.1 for 64bit with VS2008 cross compiler on 32bit WinXP. Apparently, the mentioned libs do not get linked against.

This is what I do:
- I use the 'msvc.bat vc9 win64_on32 Release adm\win64\vc9\OCCT.sln' command to start VS
- 'win64_on32' configures the cross compiler through 'env_build.bat':
set ARCH=64
set TBBARCH=intel64
set VCARCH=x86_amd64
- 'set CSF_DEFINES=HAVE_TBB;HAVE_FREEIMAGE;HAVE_GL2PS' is NOT commented out in env_build.bat
- I compile OCCT

To my surprise, the output libraries are not linked against the 3rd party libs (e.g. TKernel.dll does not depend on tbbmalloc.dll).

This is strange because when I compile the same version for 32bit it all goes well. It all goes well when I compile on a 64bit system too.

With 'Process Explorer' I can also see that CSF_DEFINES was properly set for VS so I'm pretty sure that the environment is configured properly.

So something is missing about the cross compiler configuration. Does any one have an idea what that might be?

For example, TBB is linked using the following code:

#if _MSC_VER

#ifdef _DEBUG
#pragma comment(lib, "tbbmalloc_debug.lib")
#pragma comment(lib, "tbbmalloc.lib")

Could this be that _MSC_VER is not defined or something?


Forum supervisor's picture

Dear Pawel,
Probably path to these libs are incorrect or missing.
Check, please properties of TKernel project (.../Additional Library Directories).

Pawel's picture

I think I found the problem.

In 'env_build.bat' there is a workaround section for VS2010:

rem Workaround for problems of building by VS2010 in 64 bit mode
if /I "%VCVER%" == "vc10" (
if "%ARCH%" == "64" (
set "PATH=%VS100COMNTOOLS%..\..\VC\bin\x86_amd64;%PATH%"
echo Attention: If you get problem during compilation with embedding manifests
echo ^(mt.exe^), try building ^(not rebuilding^) for the second time

A similar section is needed for VS2008.

By the way, this workaround works for a 64bit build made on a 32bit machine with a cross compiler and is probably not needed (at least not for VS2008) if you build on a 64bit machine.