dhewm/dhewm3-sdk

fatal error: 'cstddef' file not found on bigsur

xmansch opened this issue · 2 comments

Hello, can you help me with compiling sdk on mac ?

I just tried to build cdoom now and had the same issue. I modified the cmake file and this seemed to work:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -215,8 +215,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
 		add_definitions(-DMACOS_X=1)

 		if(cpu STREQUAL "x86_64")
-			add_compile_options(-arch x86_64 -mmacosx-version-min=10.6)
-			set(ldflags "${ldflags} -arch x86_64 -mmacosx-version-min=10.6")
+			add_compile_options(-arch x86_64 -mmacosx-version-min=10.9)
+			set(ldflags "${ldflags} -arch x86_64 -mmacosx-version-min=10.9")
 		elseif(cpu STREQUAL "arm64")
 			add_compile_options(-arch arm64 -mmacosx-version-min=11.0)
 			set(ldflags "${ldflags} -arch arm64 -mmacosx-version-min=11.0")
@@ -228,7 +228,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
 			endif()

 			add_compile_options(-mmacosx-version-min=10.4)
-			set(ldflags "${ldflags} -mmacosx-version-min=10.4")
+			set(ldflags "${ldflags} -mmacosx-version-min=10.9")
 		elseif(cpu STREQUAL "ppc")
 			CHECK_CXX_COMPILER_FLAG("-arch ppc" cxx_has_arch_ppc)
 			if(cxx_has_arch_ppc)

Thanks @palmerj, that fixed it for me. BTW, looks like only the first change is needed (on a 64 bit machine, anyway).