yoco
yoco

Reputation: 1424

clang_complete error: unknown argument: '--std=c++0x'

clang++ version: 2.9 vim version: 7.3

I write my .clang_comple

--std=c++0x

with follow source code test.cc:

int main () {
    return 0;
}

And the clang_complete shows

test.cc|| unknown argument: '--std=c++0x'

in the quickfix list.

I try to add the option with

set g:clang_user_options="--std=c++0x"

the problem is still there.

Tried to trace some code of clang_complete, but still can not solve that problem. All other options can be processed correctly, but not --std=c++0x Do I miss anything? or made something wrong?

Upvotes: 3

Views: 6512

Answers (2)

smartegg
smartegg

Reputation: 113

In .vimrc, I usually use the following config:

let g:clang_user_options='-std=c++0x -x c++' 
map <F2>  :call g:ClangUpdateQuickFix()<CR>

Thus, I can press to compile the *.cpp files and

then use quickfix window to debug errors.

Upvotes: 3

Mahesh
Mahesh

Reputation: 34625

It isn't --std=c++0x but -std=c++0x according to the docs. Try it but I have never used clang though.

From docs :

To use with clang you can:

  • clang++ -stdlib=libc++ test.cpp
  • clang++ -std=c++0x -stdlib=libc++ test.cpp

Upvotes: 5

Related Questions