how to run c on os 12.6

How can I run c++ on ver 12.6 MacBook Air?

Posted on May 14, 2023 1:53 AM

Reply
Question marked as Top-ranking reply

Posted on May 14, 2023 4:38 AM

Launch the Terminal application and at the command prompt, type the following and a return:


clang


That should prompt a dialog to install the last compatible Command LIne Tools for Xcode 14.2 (on Monterey) which will take about 3.2 GB. If that fails, here is the direct download link to this installer. You need to have administrator privileges, and this installation will provide you with the development environment for:


  • C (clang)
  • C++ (clang++)
  • Swift interpreter (swift)
  • Swift compiler (swiftc)
  • LLDB (debugger)
  • Python3 (3.9.6)


A typical compilation could be:


clang++ -Wall -Oz -o fib_memo fib_memo.C [ -stdlib=libc++ ] [ -std=foobar ]


That last part will prove nonsensical to clang++ and will dump a list of C++ standards it currently supports. And


clang++ -help
man clang
man lldb


will get you more information.




1 reply
Question marked as Top-ranking reply

May 14, 2023 4:38 AM in response to saptarshi79

Launch the Terminal application and at the command prompt, type the following and a return:


clang


That should prompt a dialog to install the last compatible Command LIne Tools for Xcode 14.2 (on Monterey) which will take about 3.2 GB. If that fails, here is the direct download link to this installer. You need to have administrator privileges, and this installation will provide you with the development environment for:


  • C (clang)
  • C++ (clang++)
  • Swift interpreter (swift)
  • Swift compiler (swiftc)
  • LLDB (debugger)
  • Python3 (3.9.6)


A typical compilation could be:


clang++ -Wall -Oz -o fib_memo fib_memo.C [ -stdlib=libc++ ] [ -std=foobar ]


That last part will prove nonsensical to clang++ and will dump a list of C++ standards it currently supports. And


clang++ -help
man clang
man lldb


will get you more information.




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 run c on os 12.6

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