Re: New parameter in GCC

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

 



Harry Trinta <harrytpc@xxxxxxxxx> writes:

> I wonder how do I create a parameter in Gcc.
> For example, I want the user to pass a ip address in the compilation.
> I'll use this ip later.
>
> So the question is, how to record a new parameter in Gcc?

Can you give a code example?

Take a look at the -D option.  It lets you write

gcc -DADDR=127.0.0.1 foo.c

and then in foo.c

  const char *s = ADDR;

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux