Error when compiling VTK v9.2.6 support for opencascad?

When compiling the latest OCC:

commit 8748042259f22d72b3b076bc5433a54ca42734e4 (origin/master, origin/HEAD)
Author: akaftasev <akaftasev@opencascade.com>
Date:   Mon May 22 12:00:32 2023 +0100

against VTK V9.2.6,I got this error:

In file included from /usr/include/GL/glx.h:30,
                 from /home/alex/workspace/OCCT/src/IVtkDraw/IVtkDraw_Interactor.cxx:23:
/usr/local/include/vtk-9.2/vtksys/Status.hxx:15:21: error: expected identifier before ‘int’
   15 | class vtksys_EXPORT Status
      |                     ^~~~~~
In file included from /usr/local/include/vtk-9.2/vtksys/SystemTools.hxx:7,
                 from /usr/local/include/vtk-9.2/vtkSetGet.h:35,
                 from /usr/local/include/vtk-9.2/vtkObject.h:46,
                 from /usr/local/include/vtk-9.2/vtkCommand.h:235,
                 from /usr/local/include/vtk-9.2/vtkRenderWindowInteractor.h:48,
                 from /usr/local/include/vtk-9.2/vtkXRenderWindowInteractor.h:35,
                 from /home/alex/workspace/OCCT/src/IVtkDraw/IVtkDraw_Interactor.cxx:31:
/usr/local/include/vtk-9.2/vtksys/Status.hxx:16:1: error: expected unqualified-id before ‘{’ token
   16 | {
      | ^
make[2]: *** [src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/build.make:104: src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/__/IVtkDraw/IVtkDraw_Interactor.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3656: src/TKIVtkDraw/CMakeFiles/TKIVtkDraw.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

It seems that some vtk macros don't get recognized,and I have tried to add this:

include_directories("/usr/local/include/vtk-9.2")

into /home/user/OCCT/adm/cmake/vtk.cmake,

but got no lucky,Question is:

Can this issue be fixed by modifying vtk.cmake? If yes,how?

Dmitrii Pasukhin's picture
AlexLuya's picture

Thanks,it works with master version from https://git.dev.opencascade.org/gitweb/?p=occt.git;a=summary

Dmitrii Pasukhin's picture

I found out a problem. You use Github. We will check the synchronisation.

Updated.

Best regards, Dmitrii.