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

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

下面是我的.ycm_extra_conf.py配置

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
阿神

I'm sorry that I found the wrong header file location. I shouldn't use the Internet to help you prepare it or use the default one. You still have to prepare the specific header file location yourself!
Replace the fifth line from the bottom with the following
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include'

迷茫

Run echo | clang -std=c++11 -stdlib=libc++ -v -E -x c++ - to find the system header file and add it to -isystem. If you use homebrew to install various packages, you also need to add include to -isystem, which should be '/usr/local/include',.
My ycm_config looks like this

 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',
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!