Re: g++ -D compiler options



Daniel Franklin <daniel@xxxxxxxxxxxxxxxxxxxxx> writes:

Mark Hobley wrote:

What are the effects of the -D options?

-Ddebian

[...]
These effectivly insert #defines in the preprocessor stage. Hence if you
compile with -Ddebian, and in your code you have

#ifdef debian
some code
#else
some other code
#endif

The -Ddebian is equivalent to inserting a line which says

#define debian

at the top of the C file you're currently compiling.

Possibly worth mentioning for the OP that anyone who actually used
-Ddebian
or
#ifdef debian
in their code deserves a slap. Anything that builds on Debian should
be portable to any other GNU or POSIX platform, and so Debian-specific
code is never a good idea.


Regards,
Roger

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.

Attachment: pgpnu2wOQCEWu.pgp
Description: PGP signature



Relevant Pages

  • Re: pros/cons of installing from source
    ... However debian is not the only distro with such commitment. ... I think that the packaging policy is what really sets debian ... developers, the admin of the system is the developer at the same time, ... and he/she is the one deciding what to compile against (libraries, ...
    (Debian-User)
  • ASUS A7N8X Deluxe Questions
    ... I was trying to get Debian working properly on my ... This was traced to an apparent need to compile a 2.4.22 kernel (I was ... with a Knoppix CD so I could write down my partition info. ...
    (Debian-User)
  • computer freezes, no obvious reason
    ... I recently installed debian stable. ... and compiled myself the latest kernel version: ... When I try to compile something with g++ every now and then I get the ... 00:0f.1 Audio device: nVidia Corporation MCP55 High Definition Audio (rev ...
    (Debian-User)
  • Re: VMWare player: why no package?
    ... a similar program 'Virtual Box' is packaged for Debian. ... I had to rebuild the kernel because VMWare Player requires certain ... installer will then try to compile them, but they GCC build has to match the ...
    (Debian-User)
  • Re: Suggestions Invited
    ... I was once a Gentoo fan for its emerge and quick releases, ... Debian is all about being easy to get up and keep up. ... > having to compile every little obscure library for a point update. ... > about dependencies making an upgrade of gnome or kde nearly impossible. ...
    (Debian-User)