Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么赢了';我的C代码不能编译吗?_C_Gcc_Compiler Errors - Fatal编程技术网

为什么赢了';我的C代码不能编译吗?

为什么赢了';我的C代码不能编译吗?,c,gcc,compiler-errors,C,Gcc,Compiler Errors,我正在运行“gcc foo.c” foo.c: #include "foo.h" FILE* foo(char* fileName) { ... } foo.h: #ifndef FOO_H #def FOO_H #include <stdio.h> #include <stdlib.h> FILE* foo(char* fileName); #endif 我在这里感到困惑。我使用标题的方式是否有问题?我仔细研究了这段代码一段时间,什么也找不到。命令行中的gcc

我正在运行“gcc foo.c”

foo.c:

#include "foo.h"

FILE* foo(char* fileName) {
... }
foo.h:

#ifndef FOO_H
#def FOO_H
#include <stdio.h>
#include <stdlib.h>

FILE* foo(char* fileName);

#endif

我在这里感到困惑。我使用标题的方式是否有问题?我仔细研究了这段代码一段时间,什么也找不到。命令行中的gcc语句是否错误?

因为ٰ
#def FOO\u H
应该是
#define FOO\u H

什么是
#def
?我想那是你的错误。哦,是的。谢谢
foo.c:5:1: error: expected '=', ',', ';', 'asm', or '__attribute__'
before '{' token
{