Could not build module 'Darwin' error

I worked on my own project (a simple command line in C)

after that, I was trying to compile the xnu source code using a script, and it probably changed something in my xcode configurations

because now all I'm getting is this error "Could not build module 'Darwin'" no matter what I do, I created a new workspace with a new project but the error remains.


any ideas?


Thanks!

You should probably reinstall XCode.

  1. xnu build script would corrupt the macos.sdk,
  2. download https://github.com/alexey-lysiuk/macos-sdk the correct sdk from here.
  3. replace the corrupted one with this one.

job done.

Could not build module 'Darwin' error
 
 
Q