1

My code is like this:

#include <stdio.h>
#include <string.h>
#include <signal.h>

inline void func()
{
    return;
}

int main(int argc, char const *argv[])
{
    func();
    sigset_t oldset;
}

If I use the command gcc main.c to compile, I got following error:

main.c:(.text+0x2d): undefined reference to `func'

collect2: error: ld returned 1 exit status

I guess that inline is a feature of c99. So I added "-std=c99", then I got this:

$ gcc main.c -std=c99

main.c:13:2: error: unknown type name ‘sigset_t’

How can I get both inline and sigset_t to work?

Community
  • 1
  • 1
L.Ward
  • 89
  • 9

0 Answers0