help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Defines not being caught


From: Paul Pluzhnikov
Subject: Re: Defines not being caught
Date: Fri, 18 Nov 2005 19:06:25 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Thierry" <lamthierry@gmail.com> writes:

> Assuming I'm building the test.cpp file only with the compiler flag
> -DHELLO_THERE, how come in "hello.h", it's not even aware of
> HELLO_THERE.  

If "test.cpp" in fact starts with the '#include "hello.h"' and if
"hello.h" starts with '#ifdef HELLO_THERE', then what you've
described is extremely impobable.

What's more likely is that you have some other '#includes' before
"hello.h", and it is likely that one of them has '#undef HELLO_THERE', 
which "wins" over the command line because it is later in the
input stream.

> Any help please?

You should be able to find out if that's the case by examining the
output from:

  g++ -DHELLO_THERE -E -dD test.cpp

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]