Run OpenCascade Application on other Machine

Hi there. I've jus build a small Aplication using Opencascade. Everything runs finde on the Machine where I build the Application. But even when I copy the Application including ALL DLL-Files from Opencascade into the same Directory on another machine, the Application crashs when I try to start it.....

IS it possible to run Application, built with OCC on other Machines without having to install the complete OCC Framework on that machine?

greetings
Marc

Bearloga's picture

depend.exe from MSVC will help you to know which dll is missing for running your application.

Mikael Aronsson's picture

If a DLL is missing the application does not crash, it displays a message about the missing DLL and shuts down, so in that case you will know what DLL is missing.

When you run your application in Visual Studio you get a list of all DLL's that are loaded in the output window.

If it crashes it is beacuse of another reason, I have not run any OCC app on another machine for a long time, but in the past I had to mess around with the environment variables to get my applications to run.

Naehfix's picture

Hi there. Thanks so far for your comments. Yesterday I tried to run the Application again, having OCC installed on that machine....guess what...it still crashes.
As you said, I was wondering why the Application crashes without showing any message about missing DLLs. Maybe the thing is that i compiled the Application with the currently released Visual Studio 2008. Wouldn't suprise me, if Microsoft has some built in Bugs ;)

Bearloga's picture

Did you install MSVC 8.0 on that machine? If no, then you need to install REDIST package.

Stephane Routelous's picture

you need to set some environemnt variables to be able to run OCC correctly

Stephane

stifan's picture

please help me for, create a new worspace with C++/Open Cascade

David Stifter's picture

I want to run a OCCT app wirtten on Windows 10 PC under Visual Studio 19 to run on a Windows 11 machine without OCCT. So I copied all necessary tk*.dll files into the same directory as the exe file and installed the MS Visual Studio 19 redist.
The app starts but fails when it comes to visualization (3D viewer AIS) with out an notice. Is there any specific issues I missed (any environment on windows that must be set ?
Any help is appreciated.

Kirill Gavrilov's picture

 David Stifter wrote:

The app starts but fails when it comes to visualization (3D viewer AIS) with out an notice.

How does it "fails"? You see user interface of your application, but 3D Viewer doesn't display content? Does it throws any exceptions within initialization (which then?)?

Have you checked for other errors coming from OCCT (if your application doesn't register own Message_Printer to Message::DefaultMessenger(), then you should see errors in console; if you built a non-console application /SubSystem:Windows - try building a console version for testing purposes /SubSystem:Console)?

David Stifter's picture

no output in log/console.

If I do not use any visualization in my code it works. But when I do the following:

Handle(V3d_View) view = viewer->CreateView();
Handle(Aspect_NeutralWindow) wnd = new Aspect_NeutralWindow();
wnd->SetSize(width, height);
wnd->SetVirtual(true);
view->SetWindow(wnd);
view->SetBackgroundColor(background);

At the last line, I get the error message:
Exception at 0x00007FF8155E478C in AppXXX.exe: Microsoft C++-Exception: Aspect_GraphicDeviceDefinitionError in memory at 0x00000077D352F6B8.
Any idea ?

Kirill Gavrilov's picture

David Stifter wrote:

At the last line, I get the error message:
Exception at 0x00007FF8155E478C in AppXXX.exe: Microsoft C++-Exception: Aspect_GraphicDeviceDefinitionError in memory at 0x00000077D352F6B8.

If you will wrap your code into try/catch block, you should be able to see the message within Aspect_GraphicDeviceDefinitionError exception (Standard_Failure::GetMessageString() / ::Print()).

To guess why this happen in your case, it might be necessary to show the code creating OCCT viewer from the beginning (creation of a native window wnd) and to share details of a system, where error occur. Try running some other tools to check the health of OpenGL drivers on this system like wglinfo - in some cases, they might be completely broken (incorrectly installed or corrupted in the other way).

David Stifter's picture

Hi Kirill,
I used the wglinfo and have uploaded the result here. But it is not a simple OpenGL driver issue. I could narrow down the spot where it fails. It can show 3D viewer, but it fails here in the try block (showing no specific exception, though). Here is the complete code:

Handle(Aspect_DisplayConnection) displayConnection = new Aspect_DisplayConnection();
Handle(OpenGl_GraphicDriver) graphicDriver = new OpenGl_GraphicDriver(displayConnection);
Handle(V3d_Viewer) viewer = new V3d_Viewer(graphicDriver);
viewer->SetDefaultLights();
viewer->SetLightOn();
// prepare context
Handle(AIS_InteractiveContext) context = new AIS_InteractiveContext(viewer);
// prepare off-screen view
Handle(V3d_View) view = viewer->CreateView();
Handle(Aspect_NeutralWindow) wnd = new Aspect_NeutralWindow();
wnd->SetSize(width, height);
wnd->SetVirtual(true);
try
{
view->SetWindow(wnd, nullptr);
}
catch (...) {}

Therefore: it has to do something with the NeutralWindow. The other view that is working was done according with window specific winUser.h window.
Again: on my PC (windows 10) it works as it is, but on others it fails.

kind regards,
David

Attachments: