clang_complete究竟怎么弄啊,郁闷几天,还是高不赢啊?
发表于 : 2013-04-24 1:32
.clang_complete at his root, containing the compiler options
Compiler options better to have one option per line
doesn't need to specify any of linker arguments in .clang_complete file
环境:ubuntu10.04.vim7.3
qt编译目录为:/work/GUI/opt/qt-everywhere_embedded_opensource-src-4.8.4
.
按照说明文档和参考网上的资料:
1、在工程根目录下建立.clang_complete
内容:-include-pch pch.pch -fgnu-runtime
2、也新建一个pch.h文件:包含头文件pch.h
//to assign the dependent head file
#include<iostream>#include<vector>
#include<string>#include <QApplication>
#include <QDialog>#include <QLabel>
#include <QTextCodec>#include <QFont>
3、执行命令,我把它放在pch.sh中,省得每次敲
#!/bin/sh#execute thsi script to speed up the complete clang -x c++-header ./pch.h -fno-exceptions -fnu-runtime -o ./pch.pch
4、在.vimrc中配置clang_complete
"setting for the clang_complete plugin ."
let g:clang_complete_auto = 1
let g:clang_complete_copen = 1
let g:clang_complete_quickfix= 0
let g:clang_snippets=1
let g:clang_close_preview=1"set sources for user options passed to clang
let g:clang_auto_user_options = 'path,./.clang_complete,-I/work/GUI/opt/qt-everywhere_embedded_opensource-src-4.8.4/include/'
let g:clang_complete_macros=1
let g:clang_hl_errors=1
let g:clang_complete_patterns=1
5、配置就是如上,执行pch.sh,提示QApplication找不到,应该是没有指定路径导致的。难道我在.vimrc中指定了路径不行吗??
究竟应该怎么处理才可以正确补全,深夜求解了。。
如果可以的话,可以详细一点吗,被他折磨要爆啦。。
Compiler options better to have one option per line
doesn't need to specify any of linker arguments in .clang_complete file
环境:ubuntu10.04.vim7.3
qt编译目录为:/work/GUI/opt/qt-everywhere_embedded_opensource-src-4.8.4
.
按照说明文档和参考网上的资料:
1、在工程根目录下建立.clang_complete
内容:-include-pch pch.pch -fgnu-runtime
2、也新建一个pch.h文件:包含头文件pch.h
//to assign the dependent head file
#include<iostream>#include<vector>
#include<string>#include <QApplication>
#include <QDialog>#include <QLabel>
#include <QTextCodec>#include <QFont>
3、执行命令,我把它放在pch.sh中,省得每次敲
#!/bin/sh#execute thsi script to speed up the complete clang -x c++-header ./pch.h -fno-exceptions -fnu-runtime -o ./pch.pch
4、在.vimrc中配置clang_complete
"setting for the clang_complete plugin ."
let g:clang_complete_auto = 1
let g:clang_complete_copen = 1
let g:clang_complete_quickfix= 0
let g:clang_snippets=1
let g:clang_close_preview=1"set sources for user options passed to clang
let g:clang_auto_user_options = 'path,./.clang_complete,-I/work/GUI/opt/qt-everywhere_embedded_opensource-src-4.8.4/include/'
let g:clang_complete_macros=1
let g:clang_hl_errors=1
let g:clang_complete_patterns=1
5、配置就是如上,执行pch.sh,提示QApplication找不到,应该是没有指定路径导致的。难道我在.vimrc中指定了路径不行吗??
究竟应该怎么处理才可以正确补全,深夜求解了。。
如果可以的话,可以详细一点吗,被他折磨要爆啦。。