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

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

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

7条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 04:07

    You'll need to get a compiler. The easiest way is probably to install XCode development environment from the CDs/DVDs you got with your Mac, which will give you gcc. Then you should be able compile it like

    gcc -o mybinaryfile mysourcefile.c
    

提交回复
热议问题