[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Defines not being caught
From: |
Larry Starr |
Subject: |
Re: Defines not being caught |
Date: |
Fri, 18 Nov 2005 20:09:43 -0600 |
User-agent: |
slrn/0.9.7.4 (Linux) |
In article <1132333742.884841.197020@g43g2000cwa.googlegroups.com>,
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 =----