MinGW error "undefined reference to 'typeof' '"

I get a link "undefined to" typeof "" - compiling errors and linking this:

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>

int main() {
    typeof(5);
    return 0;
}

The gcc version is 4.3.3, the command line is "gcc.exe -std = c99 1.c -o 1.exe".

+3
source share
1 answer

By passing the option -std=c99to GCC, you asked to compile it in accordance with the C99 standard, which does not support the keyword typeof.

You can use instead -std=gnu99.

+4
source

Source: https://habr.com/ru/post/1740617/


All Articles