Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

Successfully built as static lib (solved TKOpenGL dinamic load)

Successfully built as static lib (solved TKOpenGL dinamic load)
Massimo Del Fedele 2011/09/20 21:28
Hi all,

As I didn't found a solution, I made a small patch that allows to statically link OpenCascade, including the TKOpenGL stuff.
It's enough to modify Graphic3d_GraphicDevice.cxx file as :

extern "C"
{
     Handle(Graphic3d_GraphicDriver) MetaGraphicDriverFactory(const Standard_CString AShrName);
}


void Graphic3d_GraphicDevice::SetGraphicDriver ()
{

     Handle(Graphic3d_GraphicDriver)(*fp) (Standard_CString) = NULL;
     fp = (Handle(Graphic3d_GraphicDriver)(*) (Standard_CString)) MetaGraphicDriverFactory;
     Standard_CString aSharedName = "something";
     MyGraphicDriver = (*fp)(aSharedName);
}

of course, it would be possible to check if statically built or not and choose between old and
new code.

Ciao

Max
Massimo Del Fedele 2011/09/20 21:38
Or, even *much* simpler......

extern "C"
{
     Handle(Graphic3d_GraphicDriver) MetaGraphicDriverFactory(const Standard_CString AShrName);
}

void Graphic3d_GraphicDevice::SetGraphicDriver ()
{
     MyGraphicDriver = MetaGraphicDriverFactory("");
}

Just an one-line patch :-)

Ciao

Max
QiweiLiu 2013/05/15 17:45
      It's very nice.I'll try.
 
 
Latest news
  • OCCT Applications
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map