In article <[EMAIL PROTECTED]>, 
Thierry wrote:
> Let's say I have the following CPP file which include some header file:
> 
> 
> /** test.cpp **/
> #include "hello.h"
> 
> 
> /** hello.h **/
> #ifdef HELLO_THERE
> #include "someotherfile.h"
> #endif
> 
> 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.  That is, it skips the #ifdef HELLO_THERE.
> 
> Any help please?
> 
> Thanks Thierry
> 

Works, as advertized, for me.

Using your example, and not bothering to create "someotherfile.h".

         g++ -DHELLO_THERE -c testx.C
         In file included from testx.C:2:
         hello.h:3:27: someotherfile.h: No such file or directory

         g++ -c testx.C
         (No Errors returned)

This is with g++ 3.2.

Is it possible that you have another "hello.h"?

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet 
News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ 
Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
_______________________________________________
Help-gplusplus mailing list
Help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to