total noob - successful install, but cannot compile (Linux)

Hello all,

I'm an OCC-noob, however successfully downloaded opencascade-7.3.0 and successfully installed it. I'm not used to qmake, so perhaps this is why I cannot compile the two examples I found:


I can run the DRAWEXE -> DRAWEXE-7.3.0, TInspectorEXE -> TInspectorEXE-7.3.0, FuncDemo -> FuncDemo-7.3.0, IESample -> IESample-7.3.0 and Tutorial -> Tutorial-7.3.0 binaries, after running "source && source d 64 && source".

So I thought I wanted to start out by compiling something much simpler and something that doesn't depend countless other source files. That's when I found the two examples adobe (basic + sprocket). To begin, I did the following:

g++ demo_1.cpp
demo_1.cpp:2:10: fatal error: gp_Ax2.hxx: No such file or directory
 #include <gp_Ax2.hxx>
compilation terminated.

Then quickly discovered that I had to do add "-I" to the g++-commandline (I knew I needed to add something, just not exactly what):

g++ -I../opencascade-7.3.0/user/include/opencascade demo_1.cpp
demo_1.cpp:6:10: fatal error: Handle_TDocStd_Document.hxx: No such file or directory
 #include <Handle_TDocStd_Document.hxx>
compilation terminated.

Which brought up a new compiler error message (G++ can't find the file above). I searched for "Handle_TDocStd_Document.hxx" and couldn't find this, however I'm thinking the compiler is looking for either of "TDocStd_Document.cxx  TDocStd_Document.hxx  TDocStd_Document.lxx" inside the "../opencascade-7.3.0/src/TDocStd"-directory.

But I don't know how to proceed from here... I tried different combinations of "-L" to the G++ commandline. Do I need to use qmake? Could anyone please help me in the right direction? I would be grateful for any help, thanks!




Kirill Gavrilov's picture

The code you are trying to compile is outdated - it has been written for an older (much older) version of OCCT, and therefore requires some porting efforts.
Files like Handle_*.hxx has been removed since OCCT 7.0.0 (3 years ago).

The upgrade guide coming with OCCT should help you:

Of course, samples coming with OCCT are expected to be compatible with that version, so that probably you can reconsider and try finding the way for building them as first step.

Martin Joergensen's picture

Oh, I see... Thank you very much for the explanation, I should perhaps have guessed that, it makes perfect sense... It is a pity, as I think it looked like 2 very good demo examples, where I as a beginner could have learned a lot... As I'm a complete noob/beginner, I think I don't want to begin trying to upgrade those 2 demo/tutorial examples (I just tried for around 15 minutes but gave up), I think I'm spending my time way better, if I just look at the existing documentation and tutorial files... Alternatively, I could (maybe) consider installing the old version of OCCT, temporarily - until I've learned things better... Anyway, thank you very much, I'll think about what to do from here and begin working more with the included documentation/tutorial/demo files...