Building without additional libraries (like FreeImage and Gl2Ps) works great. Still it seems to me as if the MinGw build is not perfect yet, when additional libraries are used.
I have created the issue 0027397, which proposes to offer precompiled additional libraries in the download center.
But in the meantime, could you give more hints on how to build OCCT with MinGw when additional libraries are used?
Issues:
- It seems as if the CMake configuration is buggy. Static libraries created with MinGw look like that: libLibrary.a. If the "3rdparty" folder contains FreeImage and Gl2Ps like that, CMake complains that it couldn't find them. It seems as if you have adjusted that already for FreeType. Could you do it for all optional libraries?
- If I duplicate the libraries and give one file the name as chosen by MSVC, CMake accepts it and I can generate a Makefile. But during compilation, I receive the error message inserted below.
Error message:
[ 46%] Linking CXX shared library ../../win64/gcc/bin/libTKOpenGl.dll
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Text.cxx.obj):OpenGl_Text.cxx:(.text+0x39b1): undefined reference to `gl2psTextOpt'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x2104): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x2ae6): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x2dd3): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Workspace.cxx.obj):OpenGl_Workspace.cxx:(.text+0x32d3): undefined reference to `gl2psPointSize'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x4ea): undefined reference to `gl2psEndPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x577): undefined reference to `gl2psBeginPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x71a): undefined reference to `gl2psEndPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_View.cxx.obj):OpenGl_View.cxx:(.text+0x78c): undefined reference to `gl2psBeginPage'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Context.cxx.obj):OpenGl_Context.cxx:(.text+0xbc25): undefined reference to `gl2psDisable'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Context.cxx.obj):OpenGl_Context.cxx:(.text+0xbc36): undefined reference to `gl2psEnable'
CMakeFiles/TKOpenGl.dir/objects.a(OpenGl_Context.cxx.obj):OpenGl_Context.cxx:(.text+0x92f9): undefined reference to `gl2psLineWidth'
collect2.exe: error: ld returned 1 exit status
src/TKOpenGl/CMakeFiles/TKOpenGl.dir/build.make:1594: recipe for target `win64/gcc/bin/libTKOpenGl.dll' failed
make[2]: *** [win64/gcc/bin/libTKOpenGl.dll] Error 1
CMakeFiles/Makefile2:1326: recipe for target `src/TKOpenGl/CMakeFiles/TKOpenGl.dir/all' failed
make[1]: *** [src/TKOpenGl/CMakeFiles/TKOpenGl.dir/all] Error 2
Makefile:127: recipe for target `all' failed
make: *** [all] Error 2
Have you compiled OCCT with MinGw with optional libraries? Can you post here, how you did that?
Thank you very much!