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

830 views Asked by At

I am trying to learn how to program using just a text editor and terminal on 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:

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? and if so, why can't we use it?

1

There are 1 answers

0
Magnus Reftel On

The problem is not with TextEdit not saving the file correctly, but that you don“t seem to have a correctly installed compiler. Try installing XCode and its command line tools from the Mac App Store.