Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Objective C++: gcc

LCD 47 edited this page Apr 14, 2015 · 15 revisions

Maintainer: Gregor Uhlenheuer [email protected]

Checker options

The following options are supported:

In order to check header files add this to your .vimrc: (this usually creates a .gch file in your source directory)

let g:syntastic_objcpp_check_header = 1

To disable the search of included header files after special libraries like gtk and glib add this line to your .vimrc:

let g:syntastic_objcpp_no_include_search = 1

To disable the include of the default include dirs (such as /usr/include) add this line to your .vimrc:

let g:syntastic_objcpp_no_default_include_dirs = 1

To enable header files being re-checked on every file write add the following line to your .vimrc. Otherwise the header files are checked only one time on initially loading the file.

let g:syntastic_objcpp_auto_refresh_includes = 1

In order to force syntastic to refresh the header includes simply unlet b:syntastic_objcpp_includes. Then the header files are being re-checked on the next file write.

Alternatively you can set the buffer local variable b:syntastic_objcpp_cflags. If this variable is set for the current buffer no search for additional libraries is done. I.e. set the variable like this:

let b:syntastic_objcpp_cflags = '-I/usr/include/libsoup-2.4'

In order to add some custom include directories that should be added to the gcc command line you can add those to the global variable g:syntastic_objcpp_include_dirs. This list can be used like this:

let g:syntastic_objcpp_include_dirs = [ 'includes', 'headers' ]

Moreover it is possible to add additional compiler options to the syntax checking execution via the variable g:syntastic_objcpp_compiler_options:

let g:syntastic_objcpp_compiler_options = '-ansi'

Additionally the setting g:syntastic_objcpp_config_file allows you to define a file that contains additional compiler arguments like include directories or CFLAGS. The file is expected to contain one option per line. If no filename is given, it defaults to .syntastic_objcpp_config:

let g:syntastic_objcpp_config_file = '.config'

Using the global variable g:syntastic_objcpp_remove_include_errors you can specify whether errors of files included via the g:syntastic_objcpp_include_dirs setting are removed from the result set:

let g:syntastic_objcpp_remove_include_errors = 1

Use the variable g:syntastic_objcpp_errorformat to override the default error format:

let g:syntastic_objcpp_errorformat = '%f:%l:%c: %trror: %m'

Set your compiler executable with e.g. (defaults to gcc, or clang if gcc is not found):

let g:syntastic_objcpp_compiler = 'clang'

Note

This checker doesn't call the makeprgBuild() function, and thus it ignores the usual g:syntastic_objcpp_gcc_<option> variables. The only exception is g:syntastic_objcpp_gcc_exec, which can still be used to override the checker's executable.

Clone this wiki locally