错误:标头结构中FILE之前的预期说明符限定符列表

Mar*_*lle 1 c struct

嗨我得到几个编译器警告,我无法弄清楚问题.我已经解决了其他一些小问题,但这些问题只是困扰我.谢谢您的帮助

标记

agent.h:10:错误:'FILE'之前的预期说明符限定符列表

#ifndef AGENT_H
#define AGENT_H
struct AgentInfo {
      int cordRow;
      int cordCol;
      char indicator;
      char* fileName;
      char direction;
      pid_t agentPid;
      FILE* agentIn;//Error shows here
      FILE* agentOut;;
      struct AgentInfo *next;

}; 
struct AgentInfo *createLinkedList(int r,int c, char i, char *fn, char dir);
struct AgentInfo *addToLinkedList(int r,int c, char i, char *fn, char dir);
struct AgentInfo *findAgent(char* fn, struct AgentInfo **prevAgent);
extern struct AgentInfo *head = NULL;
extern struct AgentInfo *current = NULL;
#endif
Run Code Online (Sandbox Code Playgroud)

谢谢您的帮助

Nat*_*pel 5

那是因为FILE不是原始类型; 它包含在stdio.h标题中.因此,您需要#include <stdio.h>在文件中包含它.