runing .exe on another computer

hello all,

i have built and compiled a program using mfc and opencascade 4, but cant run the .exe on a computer that hasnt opencascade on it, i tried copying the required dlls into the same folder, but no luck.

apart from installing opencascade on every computer, how else can i run the .exe on a computer without opencascade?

thanks in advance.

Patrik Mueller's picture

Hi,

I think you have to look for the requested environment variables. So check and set them in your program or use a batch file to start your programm which sets them for you.

Regards,

Patrik Müller

fhchina's picture

Hi,

There is an article in OCC FAQ dicussing how to package you OCC application, you should check it. Mainly you should do three things:

1. Install shared library(.dll or .so, include compilation time linking and run-time loading dll)

2. Copy necessary resource file, such as UnitsAPI\Units.dat

3. As Petric said, Environment variable. You can setup them using InstallShield script or store them in Registry.

fhchina

Kai's picture

hello fhchina,

thanks for the advice, i followed the faq on how to create a packing using microsoft install shield for visual c++, and everything works fine, but when i install it on another computer i get "Fatal Error During Graphic Installation" after installing and trying to run the program.

is there a specific file(s) i am missing, i included all the variables and dlls stated in the faq?

please help if u can, thanks in advance.

kai.

Patrik Mueller's picture

From the FAQs:

Fatal error during graphic initialization
If you get the following error message when running an Open CASCADE based application:

Fatal error during graphic initialisation
Or if the application crashes without displaying error messages, you must set the environment variable CSF_GRAPHICSHR as follows:

On Windows, if we suppose that Open CASCADE is installed on ....E:\cascade3.0

Set CSF_GraphicShr=e:\cascade3.0\windows_nt\dll\OpenGl.dll
On linux or Unix, if we suppose that Open CASCADE is installed on ..../mydisk/cascade3.0

Setenv CSF_GraphicsShr /mydisk/cascade3.0/..../lib/OpenGl.so

Regards,
Patrik Müller

Kai's picture

Thanks Patrik,

just one question, do i change the script in the install shield to point the graphics to TKOpenGl.dll rather than just OpenGl.dll or both?

Also, if i point to the TK version which is linked via the install shield, what directoy do i write in the script?

Thanks again, very much appreciated.

Kai.

Patrik Mueller's picture

Hi,
fhchina has right. OpenGL.dll was OCC 30. So now you have to link to TKOpenGL.dll.

The directory for installshield is where you have the DLLs (I think normally the application dir).

HTH,
Patrik Müller

fhchina's picture

Hi,

If you use OCC4.0, did you ship TKOpenGL.dll with your other implicitly linked DLL?

If you has done, but still doesn't work, try to set CSF_GraphicShr environment variable to point to the location of TKOpenGL.dll

fhchina