Fatal Error During Graphic Initialisation!

I rebuild the whole OpenCascade 5.0 libraries withe vc6 under windows 2003, and each sample report such an error message, can anybody help?

Patrik Mueller's picture

Hi,

looks your windows pc doesn't have the OCC environment variables set!

Regards,

Patrik

MBD's picture

Check your CSF_GraphicShr environment variable. It should point to TKOpenGl.dll.

MBD

tom_jones's picture

The environment variable CSF_GraphicShr is correctly set.

And when I replace the TKernel.dll with the original one, some samples will run.

Patrik Mueller's picture

Hi Tom,

recompile the samples and try it again!

Regards,

Patrik

tom_jones's picture

I forgot to install the vcsp5.

Thank you for your kindly help.

Janghom Lin's picture

How to check CSF_GraphicShr environment variable and how to set it?

Patrik Mueller's picture

Hi,

here are 2 methods I use for environment variables:

void Im_AppHelper::SetEnvironmentVariable(const TCollection_AsciiString& myVarName, const TCollection_AsciiString& myVarValue)
{
OSD_Environment myEnv;
myEnv.SetName(myVarName);
if (myEnv.Value() == "")
myEnv.SetValue(myVarValue);

}

TCollection_AsciiString Im_AppHelper::GetEnvironmentValue(const TCollection_AsciiString& myVarName)
{
OSD_Environment myEnv;
myEnv.SetName(myVarName);
return myEnv.Value();
}

HTH,

Patrik

Janghom Lin's picture

I have tried your method and use
myEnv.SetValue(myVarValue) to set my OpenGl.dll path, but the valiable is still"C:\OpenCASCADE5.1\ros\win32\dll\TKOpenGl.dll".why?
thx.

Patrik Mueller's picture

If the variable is already set I work with the old one (look at the source). And "TKOpenGL.dll" isn't the same as "OpenGL.dll"!!!!!

Patrik

Janghom Lin's picture

Thank you

Armin Rainer's picture

Fehler

Amit Kumar bedaka's picture

Hi everyone,

I also got the same error "FATAL ERROR DURING GRAPHIC INITIALIZATION" when I am building the OCC environment. But when I run the example it works. This error don't have much effect on the OCC setup.