I have installed the plugin clang_complete. I put these settings in my .vimrc:
let g:clang_use_library = 1
let g:clang_auto_select = 0
let g:clang_complete_auto = 1
let g:clang_complete_copen = 1
let g:clang_complete_macros = 1
let g:clang_complete_patters = 1
set completeopt=menu,longest
let g:clang_library_path = '/usr/lib/clang'
"let g:clang_library_path = '/usr/lib/llvm-2.9'
let g:clang_auto_user_options = "-I/usr/include/c++/4.6, .clang_complete"
let g:clang_snippets = 1
let g:clang_snippets_engine = 'clang_complete'
Every time when I open the .cpp file I have got the following error message:
Error detected while processing function <SNR>15_ClangCompleteInit..LoadUserOptions:
line 20:
E121: Undefined variable: getopts#
Loading libclang failed, falling back to clang executable. Are you sure '/usr/bin/clang' contains libclang?
vim is compiled with the python feature. So vim --version is gets:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 28 2012 13:50:08)
Included patches: 1-154
... +python -python3 ...
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -Wall -g -O2 -D_FORTIFY_SOURCE=1 -I/usr/include/tcl8.5 -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_LARGEFILE64_SOURCE=1
Linking: gcc -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-Bsymbolic-functions -Wl,--as-needed -o vim -lXaw -lXmu -lXext -lXt -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -ldl -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.1 -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.12/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib -ltcl8.5 -ldl -lpthread -lieee -lm -lruby1.8 -lpthread -lrt -ldl -lcrypt -lm
Can anybody help to resolve the problem?