how to use c++ on mac without installing Xcode??

I installed turbo c++ on my Mac but isn't working on my Mac. It may be due to its 32 bit version so suggest me any app or something else that could help in using c++ on my Mac...

Posted on Dec 24, 2019 8:46 AM

Reply
4 replies

Dec 24, 2019 9:14 AM in response to ishu64

No 32-bit applications work on Catalina, and that includes the ancient turbo C++. Apple has the command line tools for Xcode which is a full C/C++/Objective-C/Objective-C++ compilation environment with support for C++17 — but does not install 8GB+ of Xcode.


In the Terminal application in Catalina, type the following on the command-line, and follow it with a return. It will trigger a prompt asking if you want to install the mentioned compilation suite (which now includes Python3):


python3


Then you can use clang or clang++ to compile your code. Be forewarned that there is much stronger typing now than in the days of Turbo C++, so you may be faced with code changes:


clang++ --help
clang++ -Oz -o foo foo.C [-stdlib=libc++] [-std=c++17]




This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to use c++ on mac without installing Xcode??

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.