Skip to content

MinGW compiling error #3

@pedroalbanese

Description

@pedroalbanese

Hello,

I'm trying to compile with MinGW getting this error:

randnum.c: In function ‘get_random_fd’:
randnum.c:37:40: error: ‘O_NONBLOCK’ undeclared (first use in this function)
37 | fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
| ^~~~~~~~~~
randnum.c:37:40: note: each undeclared identifier is reported only once for each function it appears in
randnum.c:42:3: warning: implicit declaration of function ‘srandom’; did you mean ‘srand’? [-Wimplicit-function-declaration]
42 | srandom((getpid() << 16) ^ (getpgrp() << 8) ^ getuid()
| ^~~~~~~
| srand
randnum.c:42:3: warning: nested extern declaration of ‘srandom’ [-Wnested-externs]
randnum.c:42:31: warning: implicit declaration of function ‘getpgrp’ [-Wimplicit-function-declaration]
42 | srandom((getpid() << 16) ^ (getpgrp() << 8) ^ getuid()
| ^~~~~~~
randnum.c:42:31: warning: nested extern declaration of ‘getpgrp’ [-Wnested-externs]
randnum.c:42:49: warning: implicit declaration of function ‘getuid’; did you mean ‘getpid’? [-Wimplicit-function-declaration]
42 | srandom((getpid() << 16) ^ (getpgrp() << 8) ^ getuid()
| ^~~~~~
| getpid
randnum.c:42:49: warning: nested extern declaration of ‘getuid’ [-Wnested-externs]
randnum.c:52:3: warning: implicit declaration of function ‘random’; did you mean ‘rand’? [-Wimplicit-function-declaration]
52 | random();
| ^~~~~~
| rand
randnum.c:52:3: warning: nested extern declaration of ‘random’ [-Wnested-externs]
make: *** [Makefile:32: randnum.o] Erro 1

What should i do? Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions