mardi 7 février 2017

C - Undefined reference to 'alarm'

Vote count: 0

I am trying the following code:

#include <stdio.h>
#include <unistd.h>

int main() {

   alarm(2);

   while (1) {
       printf("I am a process %d\n", getpid());
   }

   return 0;
}

But I am getting 1 warning:

implicit declaration of function 'alarm' [-Wimplicit-function-declaration]

and 1 error:

undefined reference to 'alarm'

I am using codeblocks on Windows.

asked 41 secs ago

Let's block ads! (Why?)



C - Undefined reference to 'alarm'

Aucun commentaire:

Enregistrer un commentaire