Search code examples
c++c++11clanglibc++clang-complete

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?


Solution

  • 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