1

I don't have Xcode installed on my Mac OS 13.6 but I would like to run c++ on vs code. Is there a way to do that without the need for Xcode to be installed? Also, can I run an older version of Xcode and run c++ without problems?

Note: Would be great if someone posted a link for a tutorial.

5
  • You could install a C++ compiler such as gcc: brew install gcc should install it (it might take a while!). With it you will be able to compile C++ programs. Commented Mar 5, 2022 at 17:13
  • Unfortunately, homebrew isn't supported anymore on my mac version Commented Mar 5, 2022 at 17:29
  • 1
    What do you have against XCode? Commented Mar 5, 2022 at 17:40
  • @molbdnilo Nothing, I just don't know how to use it properly, maybe due to my old macos version. Commented Mar 5, 2022 at 17:41
  • You don't need to use the IDE, you can install the command line toools and use whatever you want. Commented Mar 5, 2022 at 18:05

1 Answer 1

1

You may download and install LLVM 13.0.1 for Darwin or a small part of Xcode, Xcode command line tools: xcode-select --install.

Both will result in installing clang++.

Sign up to request clarification or add additional context in comments.

9 Comments

It through out that error: error: command line tools are already installed, use "Software Update" to install updates
I would strongly recommend going with the second options (Xcode cmdline-utils) because you most probably will need some of the other utilities as well(with or without c++!).
@OmarOshiba what happens when you type in clang++ -v?
@NikitaDemodov This causes an error: xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist Use sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools. See man xcode-select for more details.
Have you followed the tutorial? What does xcode-select -p show? If not /Library/Developer/CommandLineTools, then try sudo xcode-select --switch /Library/Developer/CommandLineTools
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.