OpenGL Building error for Android

I received about 20 errors when build OCCT. Any help correcting this will be appreciated.

[ 46%] Linking CXX shared library ..\..\lin64\clang\libi\libTKV3d.so
[ 47%] Built target TKV3d
[ 47%] Building CXX object src/TKOpenGles/CMakeFiles/TKOpenGles.dir/__/OpenGl/OpenGl_GlFunctions.cxx.o
C:\OCCT\OCCT-7_8_0\src\OpenGl\OpenGl_GlFunctions.cxx:61:7: error: no member named 'glEnable' in the global namespace
61 | ::glEnable (0xFFFF); // added to OpenGL ES 3.0
| ~~^
C:\OCCT\OCCT-7_8_0\src\OpenGl\OpenGl_GlFunctions.cxx:72:7: error: no member named 'glEnable' in the global namespace
72 | ::glEnable (0xFFFF); // added to OpenGL ES 3.1
| ~~^
C:\OCCT\OCCT-7_8_0\src\OpenGl\OpenGl_GlFunctions.cxx:83:7: error: no member named 'glEnable' in the global namespace
83 | ::glEnable (0xFFFF); // added to OpenGL ES 3.1
| ~~^
C:\OCCT\OCCT-7_8_0\src\OpenGl\OpenGl_GlFunctions.cxx:95:7: error: no member named 'glEnable' in the global namespace
95 | ::glEnable (0xFFFF); // added to OpenGL ES 3.2
| ~~^
C:\OCCT\OCCT-7_8_0\src\OpenGl\OpenGl_GlFunctions.cxx:106:7: error: no member named 'glEnable' in the global namespace
106 | ::glEnable (0xFFFF);
| ~~^
C:\OCCT\OCCT-7_8_0\src\OpenGl\OpenGl_GlFunctions.cxx:118:5: error: no member named 'glClearColor' in the global
namespace; did you mean simply 'glClearColor'?
118 | ::glClearColor (theRed, theGreen, theBlue, theAlpha);
| ^~~~~~~~~~~~~~
| glClearColor

ale land's picture

Here is more of the stack trace.

fatal error: too many errors emitted, stopping now [-ferror-limit=]
6 warnings and 20 errors generated.
mingw32-make[2]: *** [src\TKOpenGles\CMakeFiles\TKOpenGles.dir\build.make:540: src/TKOpenGles/CMakeFiles/TKOpenGles.dir/__/OpenGl/OpenGl_GlFunctions.cxx.o] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2044: src/TKOpenGles/CMakeFiles/TKOpenGles.dir/all] Error 2
mingw32-make: *** [makefile:135: all] Error 2

Dmitrii Pasukhin's picture

Hello. Do you use msys2? CRT or mingw? Could you share which CMake option you update differ from default. And OCCT version. Is it pure 7.8?
Best regards, Dmitrii.

ale land's picture

I used mingw32-make. I didn't make any changes to CMAKE. I'm using 7.8 from the download page.

ale land's picture

Oops, I did make the changes here.
https://github.com/Open-Cascade-SAS/OCCT/commit/7236e83dcc1e7284e66dc61e...
and
switched the cmake version to 3.10
cmake_minimum_required (VERSION 3.10 FATAL_ERROR)
and my changes for the android.toolchain.config.cmake
set (CMAKE_SYSTEM_NAME Android)
set (CMAKE_SYSTEM_VERSION 24) # API level
set (CMAKE_ANDROID_ARCH_ABI x86_64)
set (CMAKE_ANDROID_NDK "C:/Users/Alejandro/AppData/Local/Android/Sdk/ndk/27.0.12077973")
set (CMAKE_ANDROID_STL_TYPE c++_shared)

ale land's picture

Following up! Hoping to get some help on this. Thank you.

Dmitrii Pasukhin's picture

Hello. The issue related with missed linker's library. At the moment, difficult to help. I would recommend you check VCPKG to build for Android using that tool. Native vcpkg support OCCT 7.8.0 and 7.8.1.

I only plan to reproduce your issue to check from our side. But it is only planned, no specific date.

Best regards, Dmitrii.