From 470f0a12d41b3d55836a07b2be9d0fc4daa234f4 Mon Sep 17 00:00:00 2001 From: James Juett Date: Tue, 12 Nov 2024 09:58:59 -0500 Subject: [PATCH 1/2] add troubleshooting tip to reinstall compiler --- docs/setup_macos.md | 13 +++++++++++++ docs/setup_vscode_macos.md | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/setup_macos.md b/docs/setup_macos.md index c080fbb3..73c62bc4 100644 --- a/docs/setup_macos.md +++ b/docs/setup_macos.md @@ -99,6 +99,19 @@ Now would be a great time to take a look at our [CLI Tutorial](cli.html). Opens a file or directory with the default application, like a double click. See the [`open` command](cli.html#open--wslview) in the CLI tutorial. +## Troubleshooting +This section is for common problems and solutions. + +### Reinstall Compiler +You may notice that your compiler stops working or that the C++ standard library is unavailable (i.e. `#include` stops working) after installing other software development tools or after a macOS update. Reinstall your command line tools and compiler to fix this issue: + +```console +$ sudo rm -rf /Library/Developer/CommandLineTools +$ xcode-select --install +``` + +If you are working in an IDE like VS Code, you'll need to close and restart it as well. + ## Acknowledgments Original document written by Andrew DeOrio awdeorio@umich.edu. diff --git a/docs/setup_vscode_macos.md b/docs/setup_vscode_macos.md index 34cdbc7c..42223193 100644 --- a/docs/setup_vscode_macos.md +++ b/docs/setup_vscode_macos.md @@ -491,7 +491,10 @@ Press "Continue" to run the program to the next breakpoint, or the end, whicheve ## Troubleshooting This section is for common problems and solutions. -### Reset +### Reinstall Compiler +If your compiler or `#include`s aren't working, try [reinstalling your compiler](setup_macos.html#reinstall-compiler) to fix this issue. + +### Reset VS Code Project Settings To reset VS Code project settings and starter files, first quit VS Code. Make a backup copy of your files, and then delete your project directory. Your project directory might be different. ```console From e1a646e6641f4b4bbf125484dcd940b71ed65c21 Mon Sep 17 00:00:00 2001 From: James Juett Date: Tue, 12 Nov 2024 10:05:11 -0500 Subject: [PATCH 2/2] separate commands --- docs/setup_macos.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/setup_macos.md b/docs/setup_macos.md index 73c62bc4..e621a5c9 100644 --- a/docs/setup_macos.md +++ b/docs/setup_macos.md @@ -103,10 +103,17 @@ Opens a file or directory with the default application, like a double click. Se This section is for common problems and solutions. ### Reinstall Compiler -You may notice that your compiler stops working or that the C++ standard library is unavailable (i.e. `#include` stops working) after installing other software development tools or after a macOS update. Reinstall your command line tools and compiler to fix this issue: +You may notice that your compiler stops working or that the C++ standard library is unavailable (i.e. `#include` stops working) after installing other software development tools or after a macOS update. Reinstall your command line tools and compiler to fix this issue. + +First, remove the previous command line tools. Be careful to enter this command correctly. You will be prompted to enter your password. ```console $ sudo rm -rf /Library/Developer/CommandLineTools +``` + +Next, reinstall the command line tools. A separate window will pop up asking you to confirm. It may take several minutes to install. + +```console $ xcode-select --install ```