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

Building OCC with Samples with VS2017

Marco's picture


I try to build OCC with VS2017. I downloaded the source package for 7.1.0 und created a VS solution with CMAKE.

Then I downloaded and compile Freetype and Freeimage with VS 2017. I got problems with TK, so here I use the prebuild packages from the occ website (

I can compile the OCC libraries. That works fine, but I am getting linker errors for the Samples.

E.g. creating "Viewer3d" results in linker errors:

1>TKernel.lib(MMgt_TShared.obj) : error LNK2005: "public: virtual void __cdecl MMgt_TShared::Delete(void)const " (?Delete@MMgt_TShared@@UEBAXXZ) ist bereits in mfcsample.lib(mfcsample.dll) definiert.
1>TKernel.lib(NCollection_BaseMap.obj) : error LNK2005: "protected: void __cdecl NCollection_BaseMap::Destroy(void (__cdecl*)(class NCollection_ListNode *,class opencascade::handle<class NCollection_BaseAllocator> &),bool)" (?Destroy@NCollection_BaseMap@@IEAAXP6AXPEAVNCollection_ListNode@@AEAV?$handle@VNCollection_BaseAllocator@@@opencascade@@@Z_N@Z) ist bereits in mfcsample.lib(mfcsample.dll) definiert.
1>TKernel.lib(Standard_Transient.obj) : error LNK2005: "public: virtual void __cdecl Standard_Transient::Delete(void)const " (?Delete@Standard_Transient@@UEBAXXZ) ist bereits in mfcsample.lib(mfcsample.dll) definiert.


(The given symbol, displayed in its decorated form, was multiply defined.)

I have no idea where the problem comes from. Freetype, Freeimage is compiled with /MD or /MDd. The OCC projects also use this compile switch.

Any suggestions, hints are welcome!!!

Best regards


Kirill's picture

Your problem looks strange, but I would suggest first trying OCCT 7.2.0 (beta) which includes some fixes for compatibility with VS2017.

Marco's picture

Hi Kirill,

I tried to compile it: same problem.

I also tried to compile a console application without MFC and I am getting linker errors for the Sin, Tan etc functions from "Standard_" of TKernel. Seems the CMake files are not really up to date. Here the problem is that for static linking the define "HAVE_NO_DLL" isn't set proper in the projects files of the solution :(

Kirill's picture

I don't remember any patches for building MFC samples with OCCT static builds.
Thus samples are just not configured for such use case - using static libraries is more tricky within application project.

Karthick G's picture


Even I spent couple of days trying to run Viewer3D.exe using Visual studio 2017, without much success (I used OpenCASCADE-7.2.0-vc10-64).

I managed to build OCC7,2 with VS2017, due to the 3rd party dlls depending on VS2010, I could not run the MFC sample. It will be convenient if you people can attach a OpenCascade installer compiled with VS2017.

Best regards,


Mouhamadou Mansour MBOW's picture

Hello guys,

I have the same problem in the configuration of OCC 7.2 with VS2017.

Have you found any solution since then?

Thanks for helping.