我收到“对'typeof'的 undefined reference ” - 编译和链接时出错:
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
int main() {
typeof(5);
return 0;
}
gcc版本为4.3.3,命令行为“gcc.exe -std=c99 1.c -o 1.exe”。
最佳答案
通过将选项-std=c99
传递给GCC,您要求它根据C99标准进行编译,该标准不支持typeof
关键字。
您可能想使用-std=gnu99
。
关于c - MinGW错误 "undefined reference to '类型''",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2615860/