
Thu, 09/10/2015 - 10:51
Hello eryar,
I had to do the following change (since it seems Graphic3D.hxx no longer exists):
From this:
==================================================================================================
#include
Create a Graphic Driver from the default Aspect_DisplayConnection
Handle(Aspect_DisplayConnection) aDisplayConnection;
Handle(Graphic3d_GraphicDriver) myGraphicDriver = Graphic3d::InitGraphicDriver(aDisplayConnection);
==================================================================================================
To this:
=============================================================================================
#include
Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
Handle(OpenGl_GraphicDriver) myGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
===================================================================================================
After making such change I am getting the following compiling errors:
error1
occQt.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl OpenGl_Context::OpenGl_Context(class Handle_OpenGl_Caps const &)" (??0OpenGl_Context@@QEAA@AEBVHandle_OpenGl_Caps@@@Z) referenced in function "public: void __cdecl OpenGl_Context::`default constructor closure'(void)" (??_FOpenGl_Context@@QEAAXXZ)
error2
occQt.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl OpenGl_GraphicDriver::OpenGl_GraphicDriver(class Handle_Aspect_DisplayConnection const &,unsigned int)" (??0OpenGl_GraphicDriver@@QEAA@AEBVHandle_Aspect_DisplayConnection@@I@Z) referenced in function "private: void __cdecl occQt::InitializeModeler(void)" (?InitializeModeler@occQt@@AEAAXXZ)
And i saw Rodrigo "OpenGl_GraphicDriver on OCCT 6.8.0" after the article, I add the dependency: TKOpenGl.lib, Adding it and my program after has befor the error1 and error2.
My environment:
OCCT Version: 6.9.0
System Version: Window 7 64-bit
DevTools: Qt Creator 3.4.2
Build Kit: Desktop Qt 5.5.0 MSVC2013 64bit
this is code:
occQt.cpp
// #include
#include
void occQt::InitializeModeler( void )
{
// Handle_Aspect_DisplayConnection displayConnection;
// Handle_Graphic3d_GraphicDriver graphicDriver;
// 1. Create a 3D viewer.
/*
try
{
//myGraphicDevice = new Graphic3d_WNTGraphicDevice;
graphicDriver = Graphic3d::InitGraphicDriver(displayConnection);
}
catch (Standard_Failure)
{
QMessageBox::critical(this, tr("About occQt"),
tr("
Fatal error in graphic initialisation!
"),
QMessageBox::Apply);
}
*/
Handle(Aspect_DisplayConnection) displayConnection = new Aspect_DisplayConnection();
Handle(OpenGl_GraphicDriver) graphicDriver = new OpenGl_GraphicDriver(displayConnection);
...
}
Please forgive my broken(poor) English level and I wish your considerable advices for my mistakes sincerely,thank you very much!
mcgrady
Sat, 09/12/2015 - 18:01
Hi mcgrady,
It seems that your TKOpenGl.lib could not link correctly.
Best Regards,
Shing Liu
Mon, 09/14/2015 - 05:18
You know how to do that?