c++ - YouCompleteMe, header files -



c++ - YouCompleteMe, header files -

i working c++ header files using youcompleteme. header file not include other header files needs in order find classes using. without modifying header file, can can modify .ycm_extra_conf.py file have clang know additional header files needs?

as example, suppose have 3 files "a.h", "b.h", , "c.cc".

c.cc

#include "a.h" #include "b.h"

a.h

class {};

b.h

class b : {};

the b include file cannot compile on it's own, c.cc compile correctly because includes things in right order. however, if open b.h on it's own, complain not beingness defined.

i know c.cc compiles correctly, how tell ycm when opening b.h compile in same context utilize c.cc? flags seem insufficient tell ycm how compile file, needs compiled c.cc.

in .ycm_extra_conf.py add together regular preprocessor flags, e.g.:

flags = [ '-wall', '-wextra', '-wno-variadic-macros', '-fexceptions', '-dndebug', '-dunit_tests', '-std=c++11', '-x', 'c++', '-isystem', '/home/sehe/custom/boost', '-isystem', '/usr/lib/gcc/x86_64-linux-gnu/4.8/include', '-i', 'src', '-i', 'include', '-isystem', '/usr/include', '-isystem', '/usr/local/include', ]

c++ vim

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -