简体   繁体   中英

Mac running c program using gcc

Whenever I try to compile my c program on mac it gives the following error. I am completely clueless about it.

'sys/cdefs.h' file not found

have you installed "Xcode Command Line Tools" ? just install it in your terminal.

sudo xcode-select --install

Install Xcode, if you haven't already.

Then, from Terminal do the following to avoid future similar (not necessary just for this, I don't think) issues in future:

xcode-select --install

This will automatically download and install the latest XCode Command Line Tools.

From Xcode 4.3 , the Xcode is installed from Mac App Store. By default, there is no command line tools. Probably you have missed it. They can be installed using the Components tab of the Downloads preferences panel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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