c++ - mac系统下用带YouCompleteMe插件的vim编写cpp程序报错
PHP中文网
PHP中文网 2017-04-17 12:59:42
0
2
696

黄色三角形显示:expression result unused;
红色叉叉显示:reference to overloaded function could not be resolved;did you mean to call it?

下面是我的.ycm_extra_conf.py配置

PHP中文网
PHP中文网

认证0级讲师

모든 응답(2)
阿神

不好意思自己的头文件位置找错了,不应该用网上帮你配制或者是默认的,具体的头文件位置还是要自己配制!
倒数第五行替换换成下列
'/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里面是这样的

 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',
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿