Tue, 12/07/2021 - 11:52
I was able to build 57 DLL's with MinGW64 except TKService
Any idea what the problem could be?
Thanks!
[ 37%] Linking CXX shared library ..\..\win32\gcc\bin\libTKService.dll
CMakeFiles\TKService.dir/objects.a(Font_FontMgr.cxx.obj):Font_FontMgr.cxx:(.text+0x4bc): undefined reference to `FT_New_Face'
CMakeFiles\TKService.dir/objects.a(Font_FontMgr.cxx.obj):Font_FontMgr.cxx:(.text+0x4de): undefined reference to `FT_Select_Charmap'
CMakeFiles\TKService.dir/objects.a(Font_FontMgr.cxx.obj):Font_FontMgr.cxx:(.text+0x4ed): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FontMgr.cxx.obj):Font_FontMgr.cxx:(.text+0x761): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x122): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x433): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x444): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x46b): undefined reference to `FT_Get_Kerning'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x50d): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x522): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x54d): undefined reference to `FT_Get_Kerning'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x5cf): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x5e4): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x60f): undefined reference to `FT_Get_Kerning'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0xbcb): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0xc47): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0xd37): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0xe38): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0xf45): undefined reference to `FT_New_Memory_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0xf60): undefined reference to `FT_Select_Charmap'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0xf8b): undefined reference to `FT_Set_Char_Size'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x106e): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x10c6): undefined reference to `FT_New_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x11c1): undefined reference to `FT_MulFix'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x11de): undefined reference to `FT_Set_Transform'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1760): undefined reference to `FT_Load_Char'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x17a8): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x186e): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x192e): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1943): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x196e): undefined reference to `FT_Get_Kerning'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1a0e): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1a23): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1a4e): undefined reference to `FT_Get_Kerning'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1abd): undefined reference to `FT_Load_Char'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1af8): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1bc4): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1c48): undefined reference to `FT_Load_Char'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1c98): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x1d64): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x2015): undefined reference to `FT_Done_Face'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x25b6): undefined reference to `FT_Load_Char'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x25e8): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTFont.cxx.obj):Font_FTFont.cxx:(.text+0x280e): undefined reference to `FT_Get_Char_Index'
CMakeFiles\TKService.dir/objects.a(Font_FTLibrary.cxx.obj):Font_FTLibrary.cxx:(.text+0x14): undefined reference to `FT_Done_FreeType'
CMakeFiles\TKService.dir/objects.a(Font_FTLibrary.cxx.obj):Font_FTLibrary.cxx:(.text+0x47): undefined reference to `FT_Done_FreeType'
CMakeFiles\TKService.dir/objects.a(Font_FTLibrary.cxx.obj):Font_FTLibrary.cxx:(.text+0x111): undefined reference to `FT_Init_FreeType'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [src\TKService\CMakeFiles\TKService.dir\build.make:1802: win32/gcc/bin/libTKService.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:1830: src/TKService/CMakeFiles/TKService.dir/all] Error 2
mingw32-make: *** [Makefile:135: all] Error 2
Tue, 12/07/2021 - 13:03
Linkage errors indicate that FreeType library (external dependency) is invalid or not properly configured. Check that 3RDPARTY_FREETYPE_LIBRARY / 3RDPARTY_FREETYPE_LIBRARY_DIR point to proper locations in your CMake configuration and that FreeType library was built using MinGW for the same architecture.
Wed, 12/08/2021 - 00:18
I am using:
- Windows 10
- MinGW81
- OCCT 7.6.0
- freetype-2.6.3-mingw-64 (DLL copy to windows/ststem32) [https://dev.opencascade.org/system/files/occt/3rdparty/freetype-2.6.3-mi...
- tcltk-86-32 (tcltk-8.6.4-mingw-64 leads to an error right at the beginning) [https://dev.opencascade.org/system/files/occt/3rdparty/tcltk-86-32.zip]
I am following your instructions from https://www.youtube.com/watch?v=MBzu0xyUdJs
CMake config:
Info: TCL is used by OCCT
Found Tclsh: C:/Users/ballmer/Downloads/opencascade-additional/tcltk-86-32/bin/tclsh.exe (found version "8.6")
Info: TK is used from TCL folder: C:/Users/ballmer/Downloads/opencascade-additional/tcltk-86-32
Info: TK is used by OCCT
Info: FreeType is used by OCCT
Found Freetype: C:/Windows/System32/freetype.dll (found version "2.6.3")
Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled
Info: The directories of 3rdparty headers:
C:/Users/ballmer/Downloads/opencascade-additional/tcltk-86-32/include
C:/Users/ballmer/Downloads/opencascade-additional/freetype-2.6.3-mingw-64/include
Info: The directories of 3rdparty libraries:
C:/Users/ballmer/Downloads/opencascade-additional/tcltk-86-32/lib
C:/Users/ballmer/Downloads/opencascade-additional/freetype-2.6.3-mingw-64/lib
Info: (11:24:36) Start collecting all OCCT header files into C:/Users/ballmer/Downloads/opencascade-build/inc ...
Info: (11:24:36) Compare FILES with files in package directories...
Info: (11:24:38) Create header-links in inc folder...
Info: (11:25:05) Checking headers in inc folder...
Info: (11:25:05) End the collecting
bunch of warnings (ignoring like on the youtube video)
CMake Warning (dev) at adm/cmake/occt_toolkit.cmake:322 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "CSF_OpenGlesLibs" will no longer be dereferenced
when the policy is set to NEW. Since the policy is not set the OLD
behavior will be used.
Call Stack (most recent call first):
CMakeLists.txt:14 (include)
src/TKViewerTest/CMakeLists.txt:3 (OCCT_INCLUDE_CMAKE_FILE)
This warning is for project developers. Use -Wno-dev to suppress it.
Info: (11:25:05) OCCT toolkits processed
Info: (11:25:05) OCCT configuration files prepared
Configuring done
Generating done
Still the same error. I am lost and after 2 days ready to smash the PC, but that wouldn't help so I am thinking about getting drunk lol
Also I tried to build freetype.dll (2.11.0 ) my self with MinGw. I can combile but all I get is a libfreetype.a file and I can not find any information how to produce a DLL
BTW: MSVC2019 works without problems. All MFC Samples are working
Wed, 12/08/2021 - 01:40
To get freetype as a dll with mingw, in CMake add Entry:
BUILD_SHARED_LIBS = true
then
C:\mingw_w64\mingw32\bin\mingw32-make.exe PLATFORM=windows
this will produce a libFreetype.dll
Wed, 12/08/2021 - 10:26
I'm curious, how did you installed MinGW64? Last time I've tried I haven't found any up-to-date installation package for MinGW64 only and have to installed it through MSys2, but in that case you would have a different folders hierarchy.
Tip: use "Insert Code Snippet" in post editor to share your logs in readable way.
This is a very bad idea to copy anything into "system32" folder - it may ruin your system / break some applications.
Wed, 12/08/2021 - 18:51
I don't remember where I downloaded MinGW anymore.
It also comes with QT5 in the folder Tools. I attached the install
Thanks for the tips about the system32 folder and I agree - but I was desperate hahaha
Wed, 12/08/2021 - 19:36
I'm asking because it seems that you are using MinGW64 targeting legacy 32-bit hosts. This doesn't make sense nowadays, as it is better targeting 64-bit hosts in all aspects (performance, compatibility, working with large models), as long as you don't have specific requirements to deal with obsolete 32-bit systems.
Your building errors also come from this difference, as FreeType and Tcl/Tk libraries downloaded from OCCT portal are built for 64-bit binaries - that's why they failed with your building toolchain.
Wed, 12/08/2021 - 20:51
It was my intention to build 64bit of course. So you're saying I compile 32bit libs?
Wed, 12/08/2021 - 02:08
Hallelujah - it is working now!!
Wed, 12/08/2021 - 21:23
I was celebrating too early:
Those are the errors I get with the new libraries:
This is working (application.pro):
And this gives me the error (application.pro):
How can be the libraries be incompatible when I use the same compiler for creating the libs and running the app?
EDIT:
just checked the dll:
It is a 32-Bit, you was right - like always...
Thu, 12/09/2021 - 00:02
Installed the 64 version over msys. Made a hello world program, tested it and checked with sigcheck and it is a 64-bit exe. Path is ist correct Then I started cmake from scratch, config no errors. Generate OK. into the build folder and type 'mingw32-make.exe' starts compiling but stops with a new error:
Thu, 12/09/2021 - 03:05
start the app and this happen now
Debugging does not happen. crashes even before it comes to the main function. This usually happens when a DLL is missing.
I made sure only to load the DLL I really need. still the same.
no idea what to do now. Thanks
Thu, 12/09/2021 - 05:59
I made a minimalistic QT5 project and tried to load the DLL's:
The outcome is
The new DLL can be found but not be loaded.
Also freetype.dll is 64bit and can be loaded.
Just did a build again with
it produces a 64bit
Still not able to load
Other then the order of the depended DLL's they are the same
Thu, 12/09/2021 - 14:15
I guess QLibrary is not very helpful to get the reasons why library cannot be loaded. You may try my small tool checkdll or classical "depends" to get more details why library cannot be loaded (like missing or broken dependencies - FreeType, libgcc_s_seh-1.dll, etc.).
Thu, 12/09/2021 - 19:33
Kirill, first a big thank you for not giving up on me and thanks for the tools!
I tried
Outcome:
locks bad, but there is hope:
Hope that is a clue BUT I have the same result when I test with the 7.5.0 libs and they work for me in my software :(
I wrote above that I had to change from
to
in order to get libTKernel.dll compiled. I was assuming to use the 64 bit version but that didn't work.
Here the error again with
just saw that at the end of the error:
There is no C:/M/ folder on my drive ?!
Additional info: I did not download the code from git but from here: https://dev.opencascade.org/system/files/occt/OCC_7.6.0_release/opencasc...
Thu, 12/09/2021 - 20:37
Please see my screenshot with 2 x depends open with libTKerner.dll open on both.
On the left the (functioning) 7.5.0 and on the right 7.6.0
libTKernel can be loaded by your checkDLL64, libTKService can not be loaded
The only difference I can is is that LIBSTDC++-6.DLL doesn't have the red icon on 7.6.0 like it has on 7.5.0.
Thu, 12/09/2021 - 22:18
I just tried to rebuild 7.5.0 with no look. I get the same problem: can't load the lib.
I don't remember how I made the last set but I did somehow.
attached 2 x libTKernerl.dll from 7.5.0: one is working/loading, the other is not. Maybe you can find something.
Fri, 12/10/2021 - 09:31
I downloaded QT5.15.1 (that is what I had when I made the functioning lib's 7.5.0) just in case the MinGW version would be different and compiled the libraries again. They all don't load and also have a different file size. I must have made something different and I don't know/remember what.
What I still not understand: Why do I have to use tcltk-86-32 and not tcltk-8.6.4-mingw-64 to get libTKernel.dll going?
In fact, with tcltk-8.6.4-mingw-64 and C:\Qt5.15.2\Tools\mingw810_64\bin\mingw32-make.exe -i (ignore errors) not one single dll but all lib will be compiled.
Sun, 12/12/2021 - 00:40
I just remember: wasn't there a switch somewhere to decide if QT4 or QT5?
Sun, 12/12/2021 - 18:08
Problem solved:
added this https://packages.msys2.org/package/mingw-w64-x86_64-opencascade?repo=min... and copied all DLL's in the folder /mingw64/bin to my folder and the app is finally starting now.
replaced all libTKxxx.dll with 7.6.0 dll's and this is working now as well.