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 OCCT with MSVS 2017 - can't make it work

Igor Belyakov's picture

Hi.
I'm new to OpenCASCASE. To get started with this technology I'm trying to install OCCT following instructions in the documentation. I've built OCCT from sources with MSVS 2017 Community. The utilities for building the solution did't work just out of the box (since they know nothing about MSVS 2017) so I needed to provide paths to vcvarsall.bat and devenv.exe. The solution was built without errors. The test program "draw.bat" worked fine. Then I started to try tutorial projects and there were hundreds of errors. I've made a little test program to show you what kind of errors I had got.

In the VS 2017 project:
// main.cpp
#include <GC_MakeArcOfCircle.hxx>
#include <gp_Pnt.hxx>

int main(int argc, char *argv[])
{
    Handle(Geom_TrimmedCurve) anArcOfCircle
        = GC_MakeArcOfCircle(gp_Pnt(1.0, 0.0, 0.0),
                             gp_Pnt(0.0, 1.0, 0.0),
                             gp_Pnt(-1.0, 0.0, 0.0));
}
// end of file

In the "additional dependencies" section of the linker properties I provided full paths to TKernel.lib, TKMath.lib and TKGeomAlgo.lib from "libd" directory created during building the debug version of OCCT for x64 architecture. Configuration of the test project is "debug", x64. The same thing happens with the release configuration and OCCT .lib files from "lib" folder.

The list of errors:
1>main.obj : error LNK2019: unresolved external symbol "public: __cdecl GC_MakeArcOfCircle::GC_MakeArcOfCircle(class gp_Pnt const &,class gp_Pnt const &,class gp_Pnt const &)" (??0GC_MakeArcOfCircle@@QEAA@AEBVgp_Pnt@@00@Z) referenced in function main
1>main.obj : error LNK2019: unresolved external symbol "public: class opencascade::handle<class Geom_TrimmedCurve> const & __cdecl GC_MakeArcOfCircle::Value(void)const " (?Value@GC_MakeArcOfCircle@@QEBAAEBV?$handle@VGeom_TrimmedCurve@@@opencascade@@XZ) referenced in function "public: __cdecl GC_MakeArcOfCircle::operator class opencascade::handle<class Geom_TrimmedCurve> const &(void)const " (??BGC_MakeArcOfCircle@@QEBAAEBV?$handle@VGeom_TrimmedCurve@@@opencascade@@XZ)

A similar problem arises in Qt with MinGW compiler and OCCT libraries built for x86 architecture:
error: undefined reference to `GC_MakeArcOfCircle::GC_MakeArcOfCircle(gp_Pnt const&, gp_Pnt const&, gp_Pnt const&)'
error: undefined reference to `GC_MakeArcOfCircle::Value() const'
error: undefined reference to `Standard_Transient::DecrementRefCounter() const'
error: undefined reference to `Standard_Transient::IncrementRefCounter() const'

What am I doing wrong?