Should I consider installing a specific C++ compiler like Homebrew's g++ on macOS for VS Code, and how would that affect the 'iostream' path?

Responsive Ad Header

Question

Grade: Education Subject: Support
Should I consider installing a specific C++ compiler like Homebrew's g++ on macOS for VS Code, and how would that affect the 'iostream' path?
Asked by:
141 Viewed 141 Answers
Responsive Ad After Question

Answer (141)

Best Answer
(312)
Yes, you can use Homebrew to install g++. After installing with `brew install gcc`, you'll need to update your `c_cpp_properties.json` in VS Code to point the 'Compiler path' to the Homebrew installation (e.g., `/opt/homebrew/bin/g++` on Apple Silicon) and ensure the include paths are also adjusted accordingly.