MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030976Community[OCCT] OCCT:Configurationpublic2019-09-17 13:202020-03-04 12:24
Reportermblanchard 
Assigned Toapn 
PrioritynormalSeverityminor 
StatusassignedResolutionopen 
PlatformWindowsOSWindowsOS VersionWindows 10
Product Version[OCCT] 7.3.0 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0030976: Configuration, CMake - Build failure with static FreeType dependency
DescriptionBuilding on Windows using CMake, linking againts a static version of the FreeType library seems to be failing:

  Linking CXX shared library win64\vc14\bind\TKService.dll
  FAILED: win64/vc14/bind/TKService.dll win64/vc14/libd/TKService.lib
  LINK : fatal error LNK1104: cannot open file 'freetype.lib'

Building OCCT with -DBUILD_SHARED_LIBS=TRUE and -DBUILD_SHARED_LIBS=FALSE are both failing on my machine.

Is linking against static FreeType not supported?
Steps To Reproduce1. Build a static+debug freetyped.lib:

cmake -Bwin64-msvc2015-debug-static -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=NO -DCMAKE_INSTALL_PREFIX=/d/opt/nf-libs/freetype-2.10.1/win64-msvc2015-debug-static

Generates 'D:\opt\nf-libs\freetype-2.10.1\win64-msvc2015-debug-static\lib\freetyped.lib'.

2. Try building OCCT against that binary:

cmake -Bwin64-msvc2015-debug-static -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=NO -D3RDPARTY_FREETYPE_DIR=/d/opt/nf-libs/freetype-2.10.1/win64-msvc2015-debug-static -DBUILD_MODULE_Draw:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=/d/opt/nf-libs/opencascade-7.3.0/win64-msvc2015-debug-static

Fails...
Additional information
and documentation updates
Failing linker command:

C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe
/nologo
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_Background.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_CircularGrid.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_DisplayConnection.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_GenId.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_GradientBackground.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_Grid.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_NeutralWindow.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_RectangularGrid.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Aspect\Aspect_Window.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\SelectBasics\SelectBasics.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\SelectBasics\SelectBasics_EntityOwner.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\SelectBasics\SelectBasics_SensitiveEntity.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Image\Image_AlienPixMap.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Image\Image_Diff.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Image\Image_PixMap.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Image\Image_VideoRecorder.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\WNT\WNT_WClass.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\WNT\WNT_Window.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Font\Font_BRepFont.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Font\Font_BRepTextBuilder.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Font\Font_FontMgr.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Font\Font_FTFont.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Font\Font_FTLibrary.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Font\Font_SystemFont.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\Font\Font_TextFormatter.cxx.obj
src\TKService\CMakeFiles\TKService.dir\__\__\resources\TKService.rc.res
/out:win64\vc14\bind\TKService.dll
/implib:win64\vc14\libd\TKService.lib
/pdb:win64\vc14\bind\TKService.pdb
/dll
/version:7.3
/machine:x64
/debug
/INCREMENTAL
-LIBPATH:D:\opt\nf-libs\freetype-2.10.1\win64-msvc2015-debug-static\lib
win64\vc14\libd\TKShHealing.lib
win64\vc14\libd\TKTopAlgo.lib
opengl32.lib
windowscodecs.lib
D:\opt\nf-libs\freetype-2.10.1\win64-msvc2015-debug-static\lib\freetyped.lib
win64\vc14\libd\TKGeomAlgo.lib
win64\vc14\libd\TKBRep.lib
win64\vc14\libd\TKGeomBase.lib
win64\vc14\libd\TKG3d.lib
win64\vc14\libd\TKG2d.lib
win64\vc14\libd\TKMath.lib
win64\vc14\libd\TKernel.lib
advapi32.lib
gdi32.lib
user32.lib
Psapi.lib
wsock32.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
/MANIFEST
/MANIFESTFILE:src\TKService\CMakeFiles\TKService.dir/intermediate.manifest
src\TKService\CMakeFiles\TKService.dir/manifest.res
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
(0087204)
mblanchard (reporter)
2019-09-17 15:27

Also note that the following warning gets emitted at configure-time:

  CMake Warning at CMakeLists.txt:740 (message):
    Could not find DLLs of used third-party products: 3RDPARTY_FREETYPE_DLL_DIR
(0090810)
kgv (developer)
2020-03-04 12:23

Linking against static FreeType makes small sense when building OCCT DLLs, as several DLLs depend on FreeType.

-DBUILD_SHARED_LIBS=NO should effectively ignore paths to FreeType libraries, as linkage should be done at application stage (see adm/cmake/freetype.cmake). If this is not the case for some reason - CMake scripts should be debugged.

- Issue History
Date Modified Username Field Change
2019-09-17 13:20 mblanchard New Issue
2019-09-17 13:20 mblanchard Assigned To => bugmaster
2019-09-17 15:27 mblanchard Note Added: 0087204
2020-03-03 10:23 bugmaster Assigned To bugmaster => apn
2020-03-03 10:23 bugmaster Status new => assigned
2020-03-04 12:17 kgv Summary Build failure with static FreeType dependency => Configuration, CMake - Build failure with static FreeType dependency
2020-03-04 12:23 kgv Note Added: 0090810
2020-03-04 12:24 kgv Severity major => minor
2020-03-04 12:24 kgv Target Version => 7.5.0*


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker