xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
This is the error I get in VS Code's terminal. There are error squiggles under the "#include <stdio.h>" line.
This is after I upgraded to Mac OS Monterey.
What is the reason for this error and what is the solution?
When upgrading your Mac OS, sometimes the code command-line tools stop working. This can be resolved by running this in the terminal:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
If you don't have Xcode installed you should do:
xcode-select --install
which will install the command-line tools without having Xcode.
The fix, luckily, is pretty straight forward. Install the Xcode toolkit! Even if you had it installed before, you might have to re-register it or update it to the latest version.
$ xcode-select --install
If that doesn’t work, force it to reset. You’ll need sudo access for this one.
$ sudo xcode-select --reset
trying to learn python :
I cant install python on my mac ,some error when installing , tried donwloding all version for mac , still same error :https://www.python.org/downloads/macos/
when debuggong in VS Code : manually-specify-an-interpreter
https://code.visualstudio.com/docs/python/environments#_manually-specify-an-interpreter
tried to install an interpreter , failed
checked installed version on my mac , only found a path in
xcrun: error: invalid active developer path, problem after zsh update for flutter
this worked out
xcode-select --install
This helps me fixing
Related
Since an updates I'm not able to compile my Qt code for my Desktop environment. Qmake tells me
Project ERROR: Unknown module(s) in QT: script
Does anyone know, which package I need to install on Ubuntu 19.04 to enable the script module for Qt?
I had the same issue in Ubuntu 18.04, Qt 5.
It can be solved by installing the qtscript5-dev package:
sudo apt-get install qtscript5-dev
I am running MacOS Mojave Version 10.14.1. I am attempting to install the avr embedded development environment.
The command 'brew tap osx-cross/avr' works correctly however when the command 'brew install avr-libc' is used the following error is produced error
This produces a problem as files in c cannot be compiled due to avr-gcc being unavailable.
Any help and advice would be appreciated.
as #nos said, you need to run brew install avr-gcc.
More info here: https://github.com/osx-cross/homebrew-avr#installing-homebrew-avr-formulae
This worked for me: brew tap osx-cross/avr && brew install avr-gcc
Needed to expand brew's options of available software, as well as reference the updated avr-gcc instead of avr-libc.
So was trying to compile a c file (via a makefile) and got the "fatal error: stdio.h: No such file or directory" . This compiles on just fine via cygwin and a remote linux box just not my mac (so the files are okay).
I have installed the mac command line tools as mentioned in this question. When I do gcc --version I am getting 5.3 but if i do brew info gcc i get 8.2. When I do a find through terminal I can the file, so not sure what is up.
If you run:
which gcc
you will get /usr/bin/gcc which is the compiler supplied by Apple as part of macOS.
Presumably, since you mention homebrew, you mean to use the compiler installed by homebrew. So, you need to look in /usr/local/bin and see what homebrew has installed:
ls -l /usr/local/bin/gcc*
lrwxr-xr-x 1 mark admin 29 17 Sep 10:53 /usr/local/bin/gcc-8 -> ../Cellar/gcc/8.2.0/bin/gcc-8
So, the answer to your question is:
firstly, you need to have /usr/local/bin at the start of your PATH, and
secondly, you need to use the following command to compile:
gcc-8 main.c -o main
try running following:
xcode-select --install
See:
GCC fatal error: stdio.h: No such file or directory
for details.
With Mojave and XCODE 10, the problem is that the "include" folder is no longer automatically included when you install the command line tools. Instead, you need to do an "open" on /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
That solved the identical problem for me, anyway.
I ran into this issue and this is how I resolved it.
softwareupdate --all --install --force
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Basically developer framework is likely to be broken. But simply running xcode-select --install may not work because it will say the xcode developer tools are already installed (despite its broken status). So I had to completely wipe out any existing installation and install the developer framework again.
FYI if everything is installed correctly, the header files should be found at:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
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.
I'm trying to compile a program in C on OS X 10.9 with GCC 4.9 (experimental). For some reason, I'm getting the following error at compile time:
gcc: fatal error: stdio.h: No such file or directory
I then tried a simple Hello World program:
#include <stdio.h>
int main(int argc, const char *argv[])
{
printf("Hello, world!");
return 0;
}
Again, upon running gcc -o ~/hello ~/hello.c, I got the same error. I'm using an experimental version of gcc, but it seems implausible that there would be a release which generated errors upon importing stdio. What could be causing this issue, and how can it be fixed?
macOS
I had this problem too (encountered through Macports compilers). Previous versions of Xcode would let you install command line tools through xcode/Preferences, but xcode5 doesn't give a command line tools option in the GUI, that so I assumed it was automatically included now. Try running this command:
xcode-select --install
If you see an error message that developer tools are already installed (and still header files can't be found), wipe out any existing one to do a fresh installation:
sudo rm -rf /Library/Developer/CommandLineTools
Ubuntu
(as per this answer)
sudo apt-get install libc6-dev
Alpine Linux
(as per this comment)
apk add libc-dev
Mac OS Mojave
The accepted answer no longer works. When running the command xcode-select --install it tells you to use "Software Update" to install updates.
In this link is the updated method:
Open a Terminal and then:
cd /Library/Developer/CommandLineTools/Packages/
open macOS_SDK_headers_for_macOS_10.14.pkg
This will open an installation Wizard.
Update 12/2019
After updating to Mojave 10.15.1 it seems that using xcode-select --install works as intended.
ubuntu users:
sudo apt-get install libc6-dev
specially ruby developers that have problem installing gem install json -v '1.8.2' on their VMs
I know my case is rare, but I'll still add it here for someone who troubleshoots it later.
I had a Linux Kernel module target in my Makefile and I tried to compile my user space program together with the kernel module that doesn't have stdio.
Making it a separate target solved the problem.
I had the same problem. I installed "XCode: development tools" from the app store and it fixed the problem for me.
I think this link will help:
https://itunes.apple.com/us/app/xcode/id497799835?mt=12&ls=1
Credit to Yann Ramin for his advice. I think there is a better solution with links, but this was easy and fast.
Good luck!