错误:标头结构中FILE之前的预期说明符限定符列表(Error : expected specifier qualifier list before FILE in header 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感谢您的帮助
Hi im getting a couple of compiler warnings in and i cant figure out the problem. I have solved other little issues but this ones just bugging me. Thank you for your help
Mark
agent.h:10: error: expected specifier-qualifier-list before ‘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; #endifThank you for your help
最满意答案
那是因为FILE不是原始类型; 它包含在stdio.h头文件中。 因此,您需要在文件中使用#include <stdio.h>包含它。
That's because FILE is not a primitive type; it is contained in the stdio.h header. So you need to include it using #include <stdio.h> within your file.
更多推荐
发布评论