今天重新拾起了C语言,下载了vs code和CLion, 然后发现vs code写好代码之后头文件下方出现波浪线表示错误,百思不得其解。
然后看网上解答,找到了答案,好像是因为需要路径设置
#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/Users/…/Desktop/ctest/main.c) will be provided by the Tag Parser.
解决方法是
在命令行里面输入gcc -v -E -x c++ -在结果里面找到头文件目录,
…
#include <…> search starts here:
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/