How do I compile a .c file on my Mac?

后端 未结 7 1279
忘掉有多难
忘掉有多难 2020-12-08 03:52

How do I compile a .c file on my Mac?

7条回答
  •  执念已碎
    2020-12-08 04:20

    You will need to install the Apple Developer Tools. Once you have done that, the easiest thing is to either use the Xcode IDE or use gcc, or nowadays better cc (the clang LLVM compiler), from the command line.

    According to Apple's site, the latest version of Xcode (3.2.1) only runs on Snow Leopard (10.6) so if you have an earlier version of OS X you will need to use an older version of Xcode. Your Mac should have come with a Developer Tools DVD which will contain a version that should run on your system. Also, the Apple Developer Tools site still has older versions available for download. Xcode 3.1.4 should run on Leopard (10.5).

提交回复
热议问题