Closed tmsimont closed 8 years ago
also,
:echo has('python')
returns 1
As a side node, clang++ -std=c++11 foo.cc works without any issues to compile the project.
I don't believe you, I'm getting
$ clang++ -std=c++11 a.cpp
a.cpp:6:2: error: expected ';' after class
}
^
;
1 error generated.
I then get: -- User defined completion (^U^N^P) Pattern not found
Hm, that's weird, with your code
#include <vector>
class foo {
public:
int bar;
}
int main() {
foo f;
std::vector<int> v;
v.
}
I get autocomplete as expected.
This is a long shot, but can you try gvim
package instead of vim
? I'm using Arch too, but my version string starts with
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 2 2016 05:21:06)
Included patches: 1-2143
Compiled by Arch Linux
Huge version with GTK2 GUI. Features included (+) or not (-):
Can could you also post your clang version? Mine is:
$ clang --version
clang version 3.8.1 (tags/RELEASE_381/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Relevant section of .vimrc
:
let g:clang_use_library=1
let g:clang_complete_copen=1
let g:clang_snippets=1
let g:clang_snippets_engine='clang_complete'
let g:clang_complete_optional_args_in_snippets=1
let g:clang_close_preview=1
let g:clang_trailing_placeholder=1
let g:clang_complete_macros=1
Do you have any .clang_complete
defined for this? It works out-of-the-box for me, so if yes, you can try to delete it and try it again.
As a last point, since we already cleared that your code doesn't actually compile while you claim it does, you obviously have something else on you disk. Could you tar -cvjf
whole directory and send it to wolf@wolfsden.cz
so we can determine if it's caused by the project or by system?
Since we both use Archlinux, system differences should be reasonably easy to figure out.
You're right -- I forgot the semicolon.
I just added it, and I still get the same error:
-- User defined completion (^U^N^P) Pattern not found
However, I then removed .clang_complete
which has this line:
-include /Tree.h
The Tree.h file is in my project..
I changed it to
-include Tree.h
And it worked!
So it seems that having a bad include path in .clang_complete
was my problem.
So it seems that having a bad include path in .clang_complete was my problem.
Bad include path is ok, what caused your problem was bad include file. Basically from clang's point of view you did #include "non-existent-file.h"
, which obviously broke the compilation.
May I ask what is the reasoning of using -include Tree.h
instead of just putting #include "Tree.h"
into the .cpp
file?
I didn't know the latter would work :) I'm pretty new to this plugin.
Vim 7.4.2143
I just pulled
rip-rip/clang_complete
from the master branch yesterday.~/.vimrc
foo.cc
After typing the
f.
I see a popup with the following suggestions:This also works if I have
foo.h
and use.clang_complete
to point to the header file.However, this doesn't work with STL classes:
foo.cc
I then get:
-- User defined completion (^U^N^P) Pattern not found
I tried using
g:clang_use_library=1
, too, but this has no effect. I also triedg:clang_use_library=0
but I get an error about not being able to use binary anymore.I also tried using
g:clang_library_path
with no sucess.As a side node,
clang++ -std=c++11 foo.cc
works without any issues to compile the project.What can I do to fix?