Re: g++ -D compiler options
- From: Erik de Castro Lopo <erikd@xxxxxxxxxxxxx>
- Date: Sat, 22 Mar 2008 02:58:29 +1100
Mark Hobley wrote:
I have some C++ package files, which are currently compiled using a
command line syntax as follows:
g++ -Ddebian -D_GNU_SOURCE -g -O2 -fno-rtti -fno-exceptions -Wall
-Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE foobar.cc -c
What are the effects of the -D options?
-Ddebian
I've never seen that one before.
-D_GNU_SOURCE
That one is quite common in system header files.
Presumably, the -DUSE_TERMIO -DKLUDGELINEMODE options cause inclusion of
the enclosed definitions (or exclusion in the case of #ifndef).
Yes.
What about the -Ddebian -D_GNU_SOURCE options? Can I just drop these?
_GNU_SOURCE is probably used to include or exclude stuff in the
system header files.
The main factor in deciding if they are needed or not is if the
code compiles correctly without them. If it compiles correctly
without these defines then they aren't beeded.
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"When your hammer is C++, everything begins to look like a thumb."
-- Steve Haflich, in comp.lang.c++
.
- References:
- g++ -D compiler options
- From: Mark Hobley
- g++ -D compiler options
- Prev by Date: Re: coding text editor
- Next by Date: autoreconf: g++ compiler options in configure.ac
- Previous by thread: g++ -D compiler options
- Next by thread: Re: g++ -D compiler options
- Index(es):