John Smith
John Smith

Reputation: 6197

gcc, compiling, and NO_GLIBC is false

I want to compile something on Windows. There are a few lines:

#ifdef NO_GLIBC
#include "getopt/getopt.h"
#else
#include "sys/utsname.h"
#endif

then it fails, saying "utsname.h" is missing. Thats right, since its not a Windows thing. So somehow I have to make NO_GLIBC true, how to do this?

EDIT: Ive never programmed in C, Im a Php, Delphi expert

Upvotes: 0

Views: 70

Answers (1)

nos
nos

Reputation: 229108

You can define the NO_GLIBC macro with the -D flag given to gcc, e.g.

gcc -DNO_GLIBC=1 -c foo.c -o foo.o

Upvotes: 1

Related Questions