occ 7.5.3p2: FTBS when compiling with emscript

Hi, I'm trying to build occ with emscript to test webgl functionnality. occ FTBS with the following error:

  41%] Building CXX object src/TKService/CMakeFiles/TKService.dir/__/Graphic3d/Graphic3d_Text.cxx.o
/src/occt/src/OpenGl/OpenGl_Context.cxx:1821:100: error: use of undeclared identifier 'False'
    if (myFuncs->glXQueryCurrentRendererIntegerMESA (GLX_RENDERER_VIDEO_MEMORY_MESA, &aVMemMiB) != False)
                                                                                                   ^
[ 41%] Building CXX object src/TKService/CMakeFiles/TKService.dir/__/Graphic3d/Graphic3d_Texture1D.cxx.o
1 error generated.
em++: error: '/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=8 -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_FREETYPE -DHAVE_OPENGL -DHAVE_OPENGL_EXT -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -I/emsdk/upstream/emscripten/cache/sysroot/include/freetype2 -I/src/occt/build/include/opencascade -std=c++0x -fexceptions -fPIC -Wall -Wextra -Wshorten-64-to-32 -O3 -DNDEBUG -DOCCT_NO_PLUGINS -c /src/occt/src/OpenGl/OpenGl_Context.cxx -o CMakeFiles/TKOpenGl.dir/__/OpenGl/OpenGl_Context.cxx.o' failed (returned 1)
make[2]: *** [src/TKOpenGl/CMakeFiles/TKOpenGl.dir/build.make:466: src/TKOpenGl/CMakeFiles/TKOpenGl.dir/__/OpenGl/OpenGl_Context.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1642: src/TKOpenGl/CMakeFiles/TKOpenGl.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

unless I'm wrong 'glXQueryCurrentRendererIntegerMESA' seems to return an 'int' and not a 'bool' Could you confirm this?

Best C

Kirill Gavrilov's picture

"False" is a macros defined by X11 headers, it is not the same as "false" from C++.

It is unclear why you are trying to build that old version of OCCT with incorrect configuration (using desktop OpenGL instead of OpenGL ES).