5

After my Xcode automatically updated itself to 12.4, my Rstudio package compilation breaks and throws the following error:

    ld: framework not found CoreFoundation
    collect2: error: ld returned 1 exit status

I have tried reinstalling Xcode command-line tool; disabling csrutil and then manually creating links, but these attempts were to no avail. I would really appreciate any help!

segfault_101
  • 51
  • 1
  • 3

2 Answers2

2

add -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/ into LDFLAGS

Bai Sndav
  • 21
  • 2
2

I was able to fix this error by:

  1. Installing XCode CLI (you can find it here: https://developer.apple.com/download/all/?q=for%20Xcode)
  2. Removing ~/.R/Makevars and ~/.Renviron (you can just rename them if you don't want to delete them)
  3. Installing gfortran from here: https://github.com/fxcoudert/gfortran-for-macOS/releases
Dan Sterrett
  • 1,160
  • 11
  • 12
  • Removing the Makevars and .Renviron files did work for me, seems blunt though. I ended up deleting everything in Makevars but replacing it with everything suggested here: https://pat-s.me/transitioning-from-x86-to-arm64-on-macos-experiences-of-an-r-user/ – Michael Roswell Nov 21 '22 at 20:59