1

When I try to run a simple executable from Cmake, I get this error.

dyld[5005]: dyld cache '(null)' not loaded: syscall to map cache into shared region failed
dyld[5005]: Library not loaded: /usr/lib/libSystem.B.dylib
  Referenced from: <7EB1C677-BB05-338C-8B29-CC2803CB8C21> /Users/pop/Desktop/Lang
Reason: tried: '/usr/lib/libSystem. " B.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/libSystem.B.dylib' (no such file), '/usr/lib/libSystem.  B.dylib' (no such file, no dyld cache), '/usr/local/lib/libSystem.    B.dylib' (no such file)

My Cmake file

cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(App)
set(programName App)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeFiles/")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
file(GLOB SRC "src/*/*.c" "src/*/*.h" "src/*.c")
add_executable(App ${SRC})

I only have 1 file which a simple hello world function and multiple empty directories. Also, I have tried looking for my file

sudo find / -name libSystem.B.dylib

but not luck.

I am using an M1 chip and Ventura 13.1. Please ask for more details if you need them, as I really have no idea what to do about my problem.

kon coder
  • 11
  • 2
  • Im getting the exact some error. Im building a large project, and this only happens in the static build and only in some configurations. But so for I have not been able to understand any correlation between when it works which configuration I'm using :( – Peter Jan 04 '23 at 13:35
  • I don’t have a very good explanation but it could be related to this question: https://stackoverflow.com/questions/70549365/why-are-my-system-libraries-and-frameworks-not-visible-in-macos-monterey – Carl Winbäck May 01 '23 at 17:11

0 Answers0