On Mon, Feb 13, 2012 at 2:52 PM, Dmitry Nezhevenko
<dion@xxxxxxxxx> wrote:
On Mon, Feb 13, 2012 at 02:41:02PM -0800, Sergey Prigogin wrote:
> Doing this with additional header files was wrong to begin with. The
> supported way of letting CDT parser know about includes and defines is
> through Paths and Symbols preference settings. See also Discovery Options
> preference page.
I've double checked both options. It's possible to specify where to look
for includes or to specify some "global" definitions, that are passed as
"-D" to compiler.
But my case is a bit different. For example if I've followed c++ file:
#include <iostream>
int main()
{
my_log("Hello world!");
return 0;
}
It definitely will not be compiled/parsed since my_log() function is not
defined.
But if I try to compile it using followed command-line call:
gcc -include my_globals.h main.cpp
What prevents you from adding #include "my_globals.h" to main.cpp?
it'll be compiled correctly. "-include" behavior is like writing #include
as first line of source file.
It looks like now it's impossible to get same behavior. The best that can
be done is to add -include to discovery options that will import at least
preprocessor definitions (but not typedefs, function declarations, etc)
-sergey