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

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Usage issues / Fatal error during graphic initialization

Fatal error during graphic initialization

Fatal error during graphic initialization
Wang Jun 2011/04/16 09:45
Try to build the samples in: %CASROOT%/samples/mfc. The following steps have been done:
1. run env.bat in %CASROOT%/samples/mfc;
2. run Run_MSVC in %CASROOT%/samples/mfc; [=>All-vc8 lauched]
Then the error "Fatal error during graphic initialization" comes out. According to the forum suggestion, do
3. SET CSF_GraphicShr=%CASROOT%\ros\win32\vc8\bin\TKOpenGl.dll.

Then still got the fatal error. Please help!!!!!!!!!!!!!
Wang Jun 2011/04/16 09:49
By the way, my own application based on OCCT has no the fatal error after I set CSF_GraphicShr to %CASROOT%\ros\win32\vc8\bin\TKOpenGl.dll.
sergey zaritchny 2011/04/18 08:27
Hi,
Check, please environment variable CASROOT definition.
Probably it is not defined.
Regards
mything 2011/04/24 18:12
I do not think so.
I think it do not have any relevant for environment values.

because it can compile may OS and vc version.

I have same problems like this. but v8 mode is running and v10 mode is not.
Ausekar Shashikant R 2013/01/19 13:13
     Hi sergey zaritchny
I have successfully build the solidCAD project in VC9 on windows 7 for creating simple solids using open cascade, but facing error in debugging as"Fatal error during graphics initialization". I have set "CSF_GraphicShr" variable 'C:\OpenCASCADE6.5.4\ros\win32\vc9\bin\TKOpenGl.dll' as per forum guide. still problem not solved pls. rpl if you have any idea

Thanks & Regards
Shashikant
mything 2011/04/24 21:07
this example use env value to set each compiler ver and os

so it need 3 major environment value.

EXEDIR -> it is bin directory. ex) ---Win32/vc10/bind
LIBDIR -> lib directory. ex) ---Win32/vc10/libd
CSF_GraphicShr -> maybe inside invoked DLL. ex) Win32/vc10/bind/TkOpengl.dll

and . EXEDIR and LIBDIR used to set path.
ex) SET PATH = %LIBDIR%,%BIN_DIR%;%PATH%

you donot need to check all over the environment value.

JUST SEE RUN.BAT.. THAT'S ALL
Jun 2011/05/11 00:19
still have the problem.
hinzman 2011/05/20 17:57
Hello Jun,

I am a beginner too, had the same trouble and the setting of the CSF_GraphicShr doesn't work whatever I do.

So I rebuilded first the samples with my OS (Win 7) and Visual Studio 2008 (VC9) in win32-Debug-mode by starting the Batch File Run_MSVC.bat in the installation folder, in my case : C:\OpenCASCADE\samples\mfc.

The samples were rebuilded fine, I controlled it by looking in the folders, for my case :
C:\OpenCASCADE\samples\mfc\mfcsample\adm\win\vc9 etc.

After that I tried to start one of these samples in the development enviroment of Visual Studio 2010
and I got the message: Fatal error during graphic initialisation.

So I tried another way by using the Batch file Run.bat (in the same folder like the above mentioned Batch
file Run_MSCV.bat) from the command line of my OS with the options and the name of the favoured example, in my case the Viewer3d :

run vc9 win32 Debug Viewer3d

and the sample Viewer3d startet without the above mentioned Message: Fatal error during graphic initialisation

- vc 9 stands for Visual Studio 2008 or Visual C++ 2008, in your case you have to write vc10

I always started the Batch Files from the command line and did not closed the command line while working.

The first steps of using OCC are very hard because of setting up the system, but if you follow the documetation carefully,study und use the batch files in the installation folder, you will have sucess.

Best regards and best of luck
hinzman 2011/05/21 13:48
As an addition to the my first input above I tried to run the mfc-samples of OCC 6.5.0 on another pc with Windows XP3 and Visual Studio 2008.

Although I did it in the same way as described above I got again the failure:
"Fatal error during graphic initialisation"
when I tried to run the batch file with "run vc9 win32 Debug Viewer3d".

I tried set the enviroment CSF_GraphicShr again in several ways, but it didn't work.

For my opinion the setting of the path in which the compiled file TKOpenGl.dll is located is for runnimg the samples also very important.

So I change the batch file run.bat in the my folder C:\OpenCASCADE6.5.0\samples\mfc in this way:

................

IF not "%CASDEB%" EQU "" (
     SET EXEDIR=%~dp0%OS_TYPE%\%VCVER%\bind
     SET LIBDIR=%~dp0%OS_TYPE%\%VCVER%\libd
     SET CSF_GraphicShr=%CASROOT%\%OS_TYPE%\%VCVER%\bind\TKOpenGl.dll
     rem add in !!!!! :
SET Path=%CASROOT%\%OS_TYPE%\%VCVER%\bind\TKOpenGl.dll,%path%
) else (
     SET EXEDIR=%~dp0%OS_TYPE%\%VCVER%\bin
     SET LIBDIR=%~dp0%OS_TYPE%\%VCVER%\lib
     SET CSF_GraphicShr=%CASROOT%\%OS_TYPE%\%VCVER%\bin\TKOpenGl.dll
     rem add in !!!!! :
SET Path=%CASROOT%\%OS_TYPE%\%VCVER%\bin\TKOpenGl.dll,%path%
)
.................


After that I could start the example viewer3d from the commandline with:

" run vc9 win32 Debug Viewer3d "

and it works pretty well.

Maybe, these remarks will help you.







Jun 2011/05/25 07:20
Hello hinzman, thank you so much for the detailed information. I will try and let you know.
Nitin 2011/06/01 10:00
Hi Hinzman,

I am a beginner in OCCT and I was trying to run the Geometry tutorial. I had the error "Fatal error during graphic initialisation"
So I followed the steps that you mentioned in your earlier post.
Now it gives me an error "C:\Programme\OpenCASCADE6.5.0\samples\mfc\win32\vc8\bind\Geometry.exe is not a valid Win32 application"

How should I resolve this error. I am using Win32 XP Sp3.
Ausekar Shashikant R 2013/01/17 14:26
      Hello hinzman

I am new with open CASCADE, trying to build a simple mfc prog in vc9 on windows7 for cube, cylinder modeling. got error after successfully building prog. "fatal error in graphics initialization" ...

what is the reason for this.. rpl.

Thanks & Regards,
shashikant.
llkojnjhfy 2011/06/03 04:39
Although I did it in the same way as described above I got again the failure:
"Fatal error during graphic initialisation"
when I tried to run the batch file with "run vc9 win32 Debug Viewer3d".[URL=http://www.fakebagsok.com]fake designer bag[/URL]
TW Hsu 2012/02/27 23:14
I had the same issue and solved it. Hopefully this note would help you.
When you encounter "Fatal error during graphic initialization", it is an error on loading TKOpenGl.dll.
First, make sure that the environment variable CSF_GraphicShr is defined correctly. In the debug mode, you should see something like:

Loaded 'C:\OpenCASCADE6.5.2\ros\win32\vc9\bind\TKOpenGl.dll', Symbols loaded.

Ok, it is loaded; but still the same error. Well, TKOpenGl.dll depends on other dlls; some of the dlls cannot be loaded then. Use Dependency Walker (http://www.dependencywalker.com/) to verify its dll dependency. Fix the environment variable PATH to locate the missing dlls. Good luck!
Ben Schaeffer 2012/03/23 23:21

I have the same problem under windows 7 64-bit.

TKOpenGl.dll depends on the other DLLs like GPSVC.DLL which is 64 bit I believe. What's wrong with having OpenCascade the examples that are statically linked and do not use DLLs? I'm spending hours being really unproductive here.
Ausekar Shashikant R 2013/01/19 13:27
      Hi TW Hsu
I have successfully build the solidCAD project in VC9 on windows 7 for creating simple solids using open cascade, but facing error in debugging as"Fatal error during graphics initialization". I have set "CSF_GraphicShr" variable 'C:\OpenCASCADE6.5.4\ros\win32\vc9\bin\TKOpenGl.dll' as per forum guide. still problem not solved pls. rpl if you have any idea. It is neccessary to run.bat file..???

Thanks & Regards
Shashikant
Forum supervisor 2013/01/21 14:02
Dear Ausekar Shashikant,
You should take into account that environment definition may change time to time(at least environment of OCCT654 differs from environment of OCCT652).
The environment of the last release (OCCT654) is entirely defined by set of scripts custom.bat and env.bat.
Therefore your starting procedures as for msvc as for run.bat should correctly use the last ones.
At least you may check it with Dependency Walker.
Regards
Tushar Suradkar 2013/09/29 21:20
TW Hsu has pointed out the solution correctly. Using the Dependency Walker, open the TKOpenGl.dll and restore all required file except the DCOMP.dll and API_MS-WIN-CORE which may be ignored. This fixed the issue. Many thanks to TW Hsu !!
 
 
Latest news
  • Open CASCADE Technology 6.7.0 is available for download!
  • Open CASCADE Technology 6.6.0 is available for download!
  • Open CASCADE Technology 6.5.5 is available for download!

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