简体   繁体   English

我可以在 mac 上使用 textedit 作为文本编辑器来编写 c 程序吗?

[英]Can I use textedit on mac as the text editor for writing c program?

I am trying to learn how to program using just a text editor and terminal on mac.我正在尝试学习如何在 mac 上仅使用文本编辑器和终端进行编程。 I was trying to use textEdit as text editor and I even changed the format to plain text so that it doesn't use the rtf format but even after saving it with.c extension, each time i use the gcc hello.c -o main command on terminal it shows this: I was trying to use textEdit as text editor and I even changed the format to plain text so that it doesn't use the rtf format but even after saving it with.c extension, each time i use the gcc hello.c -o main终端上的命令显示:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Is it because we can't use textEdit for this purpose?是因为我们不能为此目的使用 textEdit 吗? and if so, why can't we use it?如果是这样,为什么我们不能使用它?

The problem is not with TextEdit not saving the file correctly, but that you don´t seem to have a correctly installed compiler.问题不在于 TextEdit 没有正确保存文件,而是您似乎没有正确安装编译器。 Try installing XCode and its command line tools from the Mac App Store.尝试从 Mac App Store 安装 XCode 及其命令行工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM