Error compiling simple program

Hi

I working on doing a small program with opencascade. I'm programming on Visual C++.

I have a problem with the libraries when I try to compile. I get this error and I absolutely don't know how to solve it:

projet viewer 3DDoc.obj : error LNK2001: unresolved external symbol "public: __thiscall BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(class gp_Pnt const &,double,double,double)" (??0BRepPrimAPI_MakeBox@@QAE@ABVgp_Pnt@@NNN@Z)
Debug/projet viewer 3D.exe : fatal error LNK1120: 1 unresolved externals

This is the simple example I'm programming

void CProjetviewer3DDoc::OnMainSTEP()
{
BRepPrimAPI_MakeBox B(gp_Pnt(0,-400,-100), 200.,150.,100.);
myBox = new AIS_Shape(B.Shape());
myAISContext->SetMaterial(myBox,Graphic3d_NOM_PEWTER);
myAISContext->SetDisplayMode(myBox,1);
myAISContext->Display(myBox);

}

Can you help me please?

thanks

Adrien

Jan Brüninghaus's picture

You must link againt the needed OCC-libraries.

halleck's picture

Hi

Thanks for you answer. Whereas, I have my libraries linked in an header files.

Here in attachement, you can find the list of libraries I have. As you can see, there is the library set up so it should work, sould it?

Do I have something wrong?

Thanks for your help

Adrien

////////////////////////

#include
#include
#include
#include
#include
#include

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

#include
//#include

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
# include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

// specific to ISession2D_Shape
#include
#include
#include
#include
#include
#include
#include

// specific IGES, STEP or DXF
#include
#include
//#include
#include

// specific IGES STEP
#include
// specific IGES, STEP or DXF
#include

// specific STEP
#include
#include
#include
// specific IGES
#include
#include
#include
#include
#include

// specific CSFDB
#include
#include
//#include
//#include
#include
#include
#include
#include
#include
#include
#include
#include "TColStd_SequenceOfAsciiString.hxx"
#include "TColStd_SequenceOfExtendedString.hxx"

//news
#include
#include

P Dolbey's picture

Unfortunatlely, the header files don't match up to the require library files. On Windows your missing lib reference would be "TKPrim.lib". However I can't be bothered working out what libs to link to so I just specify the lot and let the linker work it out i.e.

BinLPlugin.lib
BinPlugin.lib
BinXCAFPlugin.lib
DRAWEXE.lib
FWOSPlugin.lib
mscmd.lib
PTKernel.lib
StdLPlugin.lib
StdPlugin.lib
TKAdvTools.lib
TKBin.lib
TKBinL.lib
TKBinXCAF.lib
TKBO.lib
TKBool.lib
TKBRep.lib
TKCAF.lib
TKCDF.lib
TKCDLFront.lib
TKCPPClient.lib
TKCPPExt.lib
TKCPPIntExt.lib
TKCPPJini.lib
TKCSFDBSchema.lib
TKDCAF.lib
TKDraw.lib
TKernel.lib
TKFeat.lib
TKFillet.lib
TKG2d.lib
TKG3d.lib
TKGeomAlgo.lib
TKGeomBase.lib
TKHLR.lib
TKIDLFront.lib
TKIGES.lib
TKjcas.lib
TKLCAF.lib
TKMath.lib
TKMesh.lib
TKMeshVS.lib
TKOffset.lib
TKOpenGl.lib
TKPCAF.lib
TKPLCAF.lib
TKPrim.lib
TKPShape.lib
TKService.lib
TKShapeSchema.lib
TKShHealing.lib
TKStdLSchema.lib
TKStdSchema.lib
TKSTEP.lib
TKSTEP209.lib
TKSTEPAttr.lib
TKSTEPBase.lib
TKSTL.lib
TKTCPPExt.lib
TKTopAlgo.lib
TKTopTest.lib
TKV2d.lib
TKV3d.lib
TKViewerTest.lib
TKVRML.lib
TKWOK.lib
TKWOKTcl.lib
TKXCAF.lib
TKXCAFSchema.lib
TKXDEDRAW.lib
TKXDEIGES.lib
TKXDESTEP.lib
TKXml.lib
TKXmlL.lib
TKXmlXCAF.lib
TKXSBase.lib
TKXSDRAW.lib
wokcmd.lib
wokdeliverysteps.lib
wokdfltsteps.lib
wokobjssteps.lib
wokorbixsteps.lib
wokprocess.lib
woksh.lib
woksteps.lib
woktoolscmd.lib
wokutilscmd.lib
XCAFPlugin.lib
XmlLPlugin.lib
XmlPlugin.lib
XmlXCAFPlugin.lib