Generating a Mesh from TopoDS_Shape

void COpenCascadeDoc::VisualizeShape(TopoDS_Shape shape,int mode){

BRepMesh::Mesh(shape,0.1);
myAISContext->EraseAll(true);
TopoDS_Compound compound;
BRep_Builder aBuilder;
aBuilder.MakeCompound(compound);
aBuilder.Add(compound,shape);

myAISShape=new AIS_Shape(compound);
myAISContext->SetDisplayMode(myAISShape,mode,Standard_False);
myAISContext->Display(myAISShape,Standard_False);
//myAISContext->UpdateViewer(true);

CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
COpenCascadeView *pView=(COpenCascadeView*) pChild->GetActiveView();
myAISContext->UpdateCurrentViewer();

if (pView)
{
// pView->myView->MustBeResized();
pView->myView->FitAll();
pView->myView->ZFitAll();
pView->UpdateWindow();
}
//myViewer->UpdateViewer(true);

}

I get a link error saying that,

1>Creating library C:\Users\Dell\Desktop\Milinda\OpenCascade\Debug\OpenCascade.lib and object C:\Users\Dell\Desktop\Milinda\OpenCascade\Debug\OpenCascade.exp
1>OpenCascadeDoc.obj : error LNK2019: unresolved external symbol "public: static void __cdecl BRepMesh::Mesh(class TopoDS_Shape const &,double)" (?Mesh@BRepMesh@@SAXABVTopoDS_Shape@@N@Z) referenced in function "public: void __thiscall COpenCascadeDoc::VisualizeShape(class TopoDS_Shape,int)" (?VisualizeShape@COpenCascadeDoc@@QAEXVTopoDS_Shape@@H@Z)
1>C:\Users\Dell\Desktop\Milinda\OpenCascade\Debug\OpenCascade.exe : fatal error LNK1120: 1 unresolved externals

Any Suggestions to this problem.. Please Help... :)

Laszlo Kudela's picture

Dear Milinda,

did you include TKMesh.lib in your linker settings?

Milinda's picture

Hello Laszlo Kudela,

Thank You for your help. It works now... I really appreciate your help.... :)