libsdl-org / SDL_ttf

Support for TrueType (.ttf) font files with Simple Directmedia Layer.
zlib License
403 stars 131 forks source link

Bug: Error building with CMake and SDL3 #413

Closed m1maker closed 1 month ago

m1maker commented 1 month ago

Hello. I'm trying to build TTF with SDL3 and CMake and getting these errors. My CMakeLists

ExternalProject_Add(SDL3
    PREFIX "${CMAKE_BINARY_DIR}/external"
    GIT_REPOSITORY    "https://github.com/libsdl-org/SDL"
    GIT_TAG           "6771a6020da5052e22930c36cb1070a4c048ba3c"
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/installed -DSDL_STATIC=ON -DMSVC_RUNTIME_LIBRARY=MultiThreaded -DFORCE_STATIC_VCRT=ON
    )

    ExternalProject_Add(TTF
    PREFIX "${CMAKE_BINARY_DIR}/external"
    GIT_REPOSITORY    "https://github.com/libsdl-org/SDL_ttf"
    GIT_TAG           "5986e158279dbb0fe6de70e841c16bc1e9702d9f"
    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external/installed -DSDL_STATIC=ON -DMSVC_RUNTIME_LIBRARY=MultiThreaded -DFORCE_STATIC_VCRT=ON
    )

Just with SDL3, project is building good, but with TTF I getting strange build errors:

  Performing configure step for 'TTF'                                                                                   
  -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.                                           
  -- Configuring SDL3_ttf 3.0.0                                                                                         
  -- SDL3_ttf: Using vendored freetype library                                                                          
  CMake Deprecation Warning at external/freetype/CMakeLists.txt:113 (cmake_minimum_required):                           
    Compatibility with CMake < 3.5 will be removed from a future version of                                             
    CMake.                                                                                                              

    Update the VERSION argument <min> value or use a ...<max> suffix to tell                                            
    CMake that the project does not need compatibility with older versions.                                             

  -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)                                                          
  -- Configuring done (0.2s)                                                                                            
  -- Generating done (0.4s)                                                                                             
  -- Build files have been written to: C:/Users/Ecler/Documents/ngt/build/external/src/TTF-build                        
  Performing build step for 'TTF'                                                                                       
  MSBuild version 17.11.2+c078802d4 for .NET Framework                                                                  

    freetype.vcxproj -> C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\external\freetype\Release\freetype.li 
  b                                                                                                                     
    SDL_ttf.c                                                                                                           
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(318,5): error C2061: syntax error: identifier 'SDL_In 
itState' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ 
ngt\build\TTF.vcxproj]                                                                                                  
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(322,1): error C2059: syntax error: '}' [C:\Users\Ecle 
r\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]  
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1770,5): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1770,5): error C2224: left of '.refcount' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1770,5): warning C4047: 'function': 'SDL_AtomicInt *' 
 differs in levels of indirection from 'int' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared 
.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                              
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1770,5): warning C4024: 'SDL_AddAtomicInt': different 
 types for formal and actual parameter 1 [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcx 
proj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                  
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1770,5): error C2198: 'int SDL_AddAtomicInt(SDL_Atomi 
cInt *,int)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcx 
proj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                  
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1772,26): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1772,36): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1776,40): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1776,50): error C2224: left of '.library' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1776,22): error C2198: 'FT_Error FT_Init_FreeType(FT_ 
Library *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxp 
roj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                   
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1793,9): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1793,19): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1795,15): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1795,15): error C2224: left of '.refcount' must have  
struct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\D 
ocuments\ngt\build\TTF.vcxproj]                                                                                         
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1795,15): warning C4047: 'function': 'SDL_AtomicInt * 
' differs in levels of indirection from 'int' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-share 
d.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1795,15): warning C4024: 'SDL_AddAtomicInt': differen 
t types for formal and actual parameter 1 [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vc 
xproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                 
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1795,15): error C2198: 'int SDL_AddAtomicInt(SDL_Atom 
icInt *,int)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vc 
xproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                 
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1797,25): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1797,35): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1808,25): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1808,35): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1809,29): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1809,39): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1811,23): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1811,33): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1811,9): error C2198: 'void SDL_LockMutex(SDL_Mutex * 
)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\ 
Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                            
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1812,28): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1812,38): error C2224: left of '.library' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1812,47): warning C4133: 'function': incompatible typ 
es - from 'FT_Int *' to 'FT_Library' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj 
] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1812,9): error C2198: 'void FT_Library_Version(FT_Lib 
rary,FT_Int *,FT_Int *,FT_Int *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-buil 
d\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1813,25): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1813,35): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1813,9): error C2198: 'void SDL_UnlockMutex(SDL_Mutex 
 *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C 
:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1877,25): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1877,35): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1878,29): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1878,39): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1947,19): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1947,29): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1947,5): error C2198: 'void SDL_LockMutex(SDL_Mutex * 
)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\ 
Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                            
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,26): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,36): error C2224: left of '.library' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,45): warning C4133: 'function': incompatible typ 
es - from 'FT_Open_Args *' to 'FT_Library' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.v 
cxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,58): warning C4047: 'function': 'const FT_Open_A 
rgs *' differs in levels of indirection from 'long' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf 
-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,58): warning C4024: 'FT_Open_Face': different ty 
pes for formal and actual parameter 2 [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxpro 
j] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                     
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,65): warning C4047: 'function': 'FT_Long' differ 
s in levels of indirection from 'FT_Face *' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared. 
vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                               
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,65): warning C4024: 'FT_Open_Face': different ty 
pes for formal and actual parameter 3 [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxpro 
j] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                     
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1948,13): error C2198: 'FT_Error FT_Open_Face(FT_Libr 
ary,const FT_Open_Args *,FT_Long,FT_Face *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\s 
rc\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                  
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1949,21): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1949,31): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(1949,5): error C2198: 'void SDL_UnlockMutex(SDL_Mutex 
 *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C 
:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(2955,5): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(2955,5): error C2224: left of '.init' must have struc 
t/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docume 
nts\ngt\build\TTF.vcxproj]                                                                                              
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(3219,5): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(3219,5): error C2224: left of '.init' must have struc 
t/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docume 
nts\ngt\build\TTF.vcxproj]                                                                                              
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(3359,5): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(3359,5): error C2224: left of '.init' must have struc 
t/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docume 
nts\ngt\build\TTF.vcxproj]                                                                                              
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4882,27): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4882,37): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4882,13): error C2198: 'void SDL_LockMutex(SDL_Mutex  
*)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C: 
\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                           
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4883,36): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4883,46): error C2224: left of '.library' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4883,55): warning C4047: 'function': 'FT_Library' dif 
fers in levels of indirection from 'FT_Stroker *' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-s 
hared.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                         
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4883,55): warning C4024: 'FT_Stroker_New': different  
types for formal and actual parameter 1 [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxp 
roj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                   
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4883,21): error C2198: 'FT_Error FT_Stroker_New(FT_Li 
brary,FT_Stroker *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-sh 
ared.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4884,29): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4884,39): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(4884,13): error C2198: 'void SDL_UnlockMutex(SDL_Mute 
x *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [ 
C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                         
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5314,26): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5314,36): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5318,10): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5318,10): error C2224: left of '.refcount' must have  
struct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\D 
ocuments\ngt\build\TTF.vcxproj]                                                                                         
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5318,10): warning C4047: 'function': 'SDL_AtomicInt * 
' differs in levels of indirection from 'int' [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-share 
d.vcxproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5318,10): warning C4024: 'SDL_AddAtomicInt': differen 
t types for formal and actual parameter 1 [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vc 
xproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                 
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5318,10): error C2198: 'int SDL_AddAtomicInt(SDL_Atom 
icInt *,int)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vc 
xproj] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                 
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5319,29): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5319,39): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5323,9): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5323,19): error C2224: left of '.library' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5324,26): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5324,36): error C2224: left of '.library' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5324,9): error C2198: 'FT_Error FT_Done_FreeType(FT_L 
ibrary)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj 
] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5325,9): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5325,19): error C2224: left of '.library' must have s 
truct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Do 
cuments\ngt\build\TTF.vcxproj]                                                                                          
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5328,9): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5328,19): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5329,26): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5329,36): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5329,9): error C2198: 'void SDL_DestroyMutex(SDL_Mute 
x *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [ 
C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                         
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5330,9): error C2065: 'TTF_state': undeclared identif 
ier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\b 
uild\TTF.vcxproj]                                                                                                       
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5330,19): error C2224: left of '.lock' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5333,25): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5333,35): error C2224: left of '.init' must have stru 
ct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Docum 
ents\ngt\build\TTF.vcxproj]                                                                                             
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5338,30): error C2065: 'TTF_state': undeclared identi 
fier [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\Documents\ngt\ 
build\TTF.vcxproj]                                                                                                      
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5338,40): error C2224: left of '.refcount' must have  
struct/union type [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxproj] [C:\Users\Ecler\D 
ocuments\ngt\build\TTF.vcxproj]                                                                                         
C:\Users\Ecler\Documents\ngt\build\external\src\TTF\src\SDL_ttf.c(5338,12): error C2198: 'int SDL_GetAtomicInt(SDL_Atom 
icInt *)': too few arguments for call [C:\Users\Ecler\Documents\ngt\build\external\src\TTF-build\SDL3_ttf-shared.vcxpro 
j] [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                                                     
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): e 
rror MSB8066: Custom build for 'C:\Users\Ecler\Documents\ngt\build\CMakeFiles\5f002ab64021415b1c406f18f4608308\TTF-patc 
h.rule;C:\Users\Ecler\Documents\ngt\build\CMakeFiles\5f002ab64021415b1c406f18f4608308\TTF-configure.rule;C:\Users\Ecler 
\Documents\ngt\build\CMakeFiles\5f002ab64021415b1c406f18f4608308\TTF-build.rule;C:\Users\Ecler\Documents\ngt\build\CMak 
eFiles\5f002ab64021415b1c406f18f4608308\TTF-install.rule;C:\Users\Ecler\Documents\ngt\build\CMakeFiles\60d4fd8317dec9de 
ea6b5a4d898962a4\TTF-complete.rule;C:\Users\Ecler\Documents\ngt\build\CMakeFiles\8c6c19321573fcd848677996a47b3b75\TTF.r 
ule' exited with code 1. [C:\Users\Ecler\Documents\ngt\build\TTF.vcxproj]                                               
  1>                                                                                                                    
madebr commented 1 month ago

Make sure you're using latest SDL3 and SDL3_ttf. From your logs it appears they are incompatible.

m1maker commented 1 month ago

I updated Git tag for SDL3 project, but no changes.

madebr commented 1 month ago

ExternalProject is for handling external projects that you only want to make available. Your code cannot depend on them, and these projects can also not depend on each other.

If you want to build your application in the same project, and link to it using SDL3::SDL3, you need to use the functions provided by FetchContent instead.

Having said that, after adding DEPENDS SDL3 to the arguments of the second ExternalProject_Add, I got it working on Linux. (I also added GIT_SHALLOW TRUE for faster cloning)

Also, verify the CMAKE_ARGS: -DSDL_SHARED and -DSDL_STATIC are SDL3-only options, not used by SDL_ttf. Use DBUILD_SHARED_LIBS=... for the satellite libraries.

Also, -DFORCE_STATIC_VCRT is not used by any SDL library.

Also, MSVC_RUNTIME_LIBRARY is not a CMake variable. You probably meant CMAKE_MSVC_RUNTIME_LIBRARY

But as I said before, you probably want to use FetchContent instead.