Getting started with 7.9.0

I downloaded and installed 7.9.0 from here - at first the non-debug versions, which turned to be a mistake.

Download the ones with the debug files, preferably the one with the 3rd party apps bundled (though I have no idea yet what they will be used for), the directory structure will then just be fine.

After unpacking, running the occt-vc144-64-with-debug\draw.bat worked out of the box.

Gabor Jakab's picture

tldr: the tb12_debug.dll and jemalloc.dll is missing.

Next, I installed Visual Studio 2022 (community version). Took some time. I chose to have the C++ environment for obvious reasons and the English language pack as most help/video is probably available only in this language.

Once the installation was done, I created a new empty project and saved it at a suitable location.

I set the App language to English (Tools>Options>Environment>International settings).

Now this is where my knowledge ended so I googled something like "starting opencascade with visual studio" and found Quaoar Workshop's video. This shows how to set up the linker, debugger and whatnot so the IDE finds everything it needs. This was the video btw. that made clear I need the debug versions from the downloads.

Setting up the environment under Project Properties, taking care of the configuration and platform being Debug and x64:

  • added "C:\occt790\occt-vc144-64-with-debug\inc" to the includes under C/C++>General>Additional Include Headers,

  • added "C:\occt790\occt-vc144-64-with-debug\win64\vc14\libd" to Linker>General>Additional Library Directories

  • added all .lib files from "C:\occt790\occt-vc144-64-with-debug\win64\vc14\libd" to Linker>Input>Additional Dependencies. Probably a bit too much but OK for now.

  • set Configuration Properties>Debugging>Environment to "PATH=C:\occt790\occt-vc144-64-with-debug\win64\vc14\bind;%PATH%;"

All together I set:

  • the location of the headers

  • the location of the .lib files and the files

  • the location of the debug .dll files

Running it in debug mode - fails.

I got lots of error messages like "Loaded 'C:\Windows\System32\msvcrt.dll'. Symbol loading disabled by Include/Exclude setting". I went to Tools>Options>Debugging>Symbols and set the symbol search preferences from automatic to "Search for all module symbols unless excluded".

Running it in debug mode - fails.

I got the message, that tbb12_debug.dll is missing. Running without debugging showed that jemalloc.dll is also missing.

I'm currently stuck at this point and I'd like to get some advice how/where to get these files from.

Gabor Jakab's picture

I just found the following line in OpenCASCADEConfig.cmake:

set (OpenCASCADE_WITH_TBB TRUE)

It means tbb is used - but it isn't included? Or do I need to set something else in Visual Studio?

Gabor Jakab's picture

I found the dlls!

In the 3rd party directory there is a tbb and a jemalloc subdir, both containing a bin with the missing dlls. I added these to the Project Properties>Configuration Properties>Debugging>Environment and voilá - the code compiled successfully - I created my very first OCCT App.

Gabor Jakab's picture

Next step: making it work in release mode and getting to the point where the app can be started from outside the IDE.

For this the profile is set to Release.

Then,

  • set the path to the header files again, to the same value as for the Debug profile.

  • in Linker>General>Additional Library Directories where the /libd directories were set for the linker, the /lib is used now - simply delete the d.

  • Configuration Properties>Debugging>Environment should point to "C:\occt790\occt-vc144-64-with-debug\win64\vc14\bin" - also, just delete the d.

  • build the exe - should build without any problem.

  • for simplicity: copy all dll files from the "C:\occt790\occt-vc144-64-with-debug\win64\vc14\bin" directory to the directory where the .exe sits

  • copy the jemalloc and tbb12.dll files, too. In my case I had to copy the tbb12_debug.dll as well for whatever reason.

Now the exe runs from outside Visual Studio!