84669인 학습
152542인 학습
20005인 학습
5487인 학습
7821인 학습
359900인 학습
3350인 학습
180660인 학습
48569인 학습
18603인 학습
40936인 학습
1549인 학습
1183인 학습
32909인 학습
黄色三角形显示:expression result unused;红色叉叉显示:reference to overloaded function could not be resolved;did you mean to call it?
下面是我的.ycm_extra_conf.py配置
认证0级讲师
不好意思自己的头文件位置找错了,不应该用网上帮你配制或者是默认的,具体的头文件位置还是要自己配制!倒数第五行替换换成下列'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include'
运行 echo | clang -std=c++11 -stdlib=libc++ -v -E -x c++ - 找到系统的头文件,加入-isystem里面。如果你用了homebrew安装了各种包的话,也需要把include加入-isystem里面,应该是'/usr/local/include',。我的ycm_config里面是这样的
echo | clang -std=c++11 -stdlib=libc++ -v -E -x c++ -
-isystem
'/usr/local/include',
53 'c++', 54 '-isystem', #Mark as system header 55 #Using `echo | clang -std=c++11 -stdlib=libc++ -v -E -x c++ -` to generate the following infos 56 '/usr/local/include', 57 '-isystem', 58 '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1', 59 '-isystem', 60 '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0/include', 61 '-isystem', 62 '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include', 63 '-isystem', 64 '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include', 65 '-isystem', 66 '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks',
不好意思自己的头文件位置找错了,不应该用网上帮你配制或者是默认的,具体的头文件位置还是要自己配制!
倒数第五行替换换成下列
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include'
运行
echo | clang -std=c++11 -stdlib=libc++ -v -E -x c++ -
找到系统的头文件,加入-isystem
里面。如果你用了homebrew安装了各种包的话,也需要把include加入-isystem
里面,应该是'/usr/local/include',
。我的ycm_config里面是这样的