MacOS祖传bug

问题:

/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:20:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
^~~~~~~~~~
1 error generated.
error: command '/Library/Developer/CommandLineTools/usr/bin/clang' failed with exit code 1

解决方案:

Before you proceed, make sure to install xcode command line tools.

xcode-select --install
Actually, you can do it! Actually all the C headers are found here in this folder:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/
We just need to create symlink for all the headers file into this folder:

/usr/local/include/
It worked for me! the following command line will take care of all the problems:

sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

 

posted @ 2023-05-13 10:50  带狗狗带  Views(31)  Comments(0Edit  收藏  举报