title: After Mac Mojave update: gfortran error "ld: library not found for -lcrt1.o collect2: error: ld returned 1 exit status"
body: <p>After updating to MacOS Mojave, I get an error when compiling with gfortran.</p>
  
  <pre><code>gfortran: warning: couldn’t understand kern.osversion ‘18.0.0
  ld: library not found for -lcrt1.o
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>This error did not occur before the update. I tracked similar threads and followed their proposed solutions. However, I got further errors when following ...</p>
  
  <ul>
  <li>Update XCode: Now updated to version 10.0. </li>
  <li><p>Run <code>xcode-select --install</code>: I get the following error: <code>xcode-select: error: command line tools are already installed, use "Software Update" to install updates</code>. Following <a href="https://stackoverflow.com/questions/34617452/how-to-update-xcode-from-command-line">this thread</a>, I did <code>softwareupdate --list</code> and get <code>No new software available.</code>. I conclude, that XCode updating is not the problem here. I also made sure that additional tools are installed upon first opening the updated XCode. </p></li>
  <li><p>Following <a href="https://github.com/Homebrew/legacy-homebrew/issues/45011" rel="nofollow noreferrer">this thread</a>, where a similar error was reported, I did <code>brew doctor</code>. Something goes wrong here. I get <code>Warning: Your Xcode (1) is outdated; Please update to Xcode 7.1.</code> Apparently it doesn't recognise to confirmed fact that my XCode is at 10.0. What can be done about that?</p></li>
  <li><p>Following <a href="https://github.com/JuliaLang/julia/issues/19588#issuecomment-266979910" rel="nofollow noreferrer">this thread</a>, I did <code>brew upgrade gcc</code> and get this error: <code>Warning: You are using OS X 10.14.; ...</code>.</p></li>
  <li><p>With so many brewing errors, I checked the <a href="https://github.com/Homebrew/brew/blob/master/docs/Troubleshooting.md" rel="nofollow noreferrer">brew troubleshooting site</a>, and followed their recommendations. I did <code>cd /usr/local &amp;&amp; sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks</code> and again <code>brew update</code> and get this error: <code>Error: The /usr/local directory is not writable. ...</code>.  Following the recommendation in the error message, I did <code>sudo chown -R $(whoami):admin /usr/local</code> but get the error <code>chown: /usr/local: Operation not permitted</code>. </p></li>
  <li><p><code>brew reinstall gcc</code> sounds like I would get the same error as in the previous point. Haven't tried so far, worrying for making the mess even worse.</p></li>
  </ul>
  
  <p>Bottom line: I drowned in errors and see no solution. Any ideas what's the problem and how to solve it are appreciated!</p>