Neomake: Add support for C++11

Created on 18 Nov 2015  路  5Comments  路  Source: neomake/neomake

In syntastic I can do something like that

let g:syntastic_cpp_compiler_options = ' -std=c++11'

Is there any possiblity to achieve the same idea with Neomake?

Most helpful comment

I spent a few hours figuring this out for myself. How I did it was this:

I have, in my init.vim

let g:neomake_cpp_enable_markers=['clang']
let g:neomake_cpp_clang_args = ["-std=c++14", "-Wextra", "-Wall", "-fsanitize=undefined","-g"]

That's all I need to have C++14 with clang and neovim with neomake. I also have au! BufWritePost * Neomake in my init.vim so that it automatically runs whenever I write the file. Fairly sweet setup so far.

All 5 comments

I spent a few hours figuring this out for myself. How I did it was this:

I have, in my init.vim

let g:neomake_cpp_enable_markers=['clang']
let g:neomake_cpp_clang_args = ["-std=c++14", "-Wextra", "-Wall", "-fsanitize=undefined","-g"]

That's all I need to have C++14 with clang and neovim with neomake. I also have au! BufWritePost * Neomake in my init.vim so that it automatically runs whenever I write the file. Fairly sweet setup so far.

@dolohow - @thang1thang2's answer is the right way to do things. Let me know if that doesn't resolve your issue.

Works like charm :)

Note for anyone who finds this solution: my clang++ on osx didn't like the -fsanitize=undefined option, worked fine when I took that flag out.

Thanks @thang1thang2! That did it. For others looking at this - notice how it's enabled_makers and not _enable_markers_. At first I didn't notice and was wondering what was wrong. Correct:

let g:neomake_cpp_enabled_makers=['clang']
let g:neomake_cpp_clang_args = ["-std=c++14"]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sakhnik picture sakhnik  路  5Comments

towry picture towry  路  5Comments

mcnelson picture mcnelson  路  4Comments

sassanh picture sassanh  路  6Comments

pengowen123 picture pengowen123  路  6Comments