Re: D_GNU_SOURCE option for gcc?
stephen parkinson <stephen <at> zmemw16.demon.co.uk> writes:
>
> Thomas H. George wrote:
>
> > I am using source code from UNIX SYSTEMS PROGRAMMING by Robbins &
> > Robbins. It gives a compiler error unless compiled with the option
> > -D_GNU_SOURCE .
> > Where does this option come from - its not in the man pages? Why is
> > it needed when using the Debian gcc and g++ packages?
> >
> > Curious,
> >
> > Tom
> >
> >
> >
> 30sec google search suggests it should perhaps be
>
> -DGNU_SOURCE
>
No, it should not.
gcc -D_GNU_SOURCE hello.c
means the compiler will use the GNU standard of compilation, the superset of all
other standards under GNU C libraries.
gcc -g -D_GNU_SOURCE hello.c -o hello
is better, because it will provide nice info when debugging.
The op should get a beginner's book on programming win GNU/Linux.
Cheers,
Henry
Reply to: