gcc:编译 expected declaration specifiers or ‘...’ before
来源:互联网 发布:移动4g网络最近怎么了 编辑:程序博客网 时间:2024/05/16 00:25
这种错误,一般是头文件include混乱造成的。
实例:
In file included from ftpp.h:6:0,
from ftpp.c:2:
parser.h:17:30: 错误:expected declaration specifiers or ‘...’ before ‘tFtpMsg’
parser.h:19:30: 错误:expected declaration specifiers or ‘...’ before ‘tFtpMsg’
parser.h:
================
#ifndef _PARSER_H_
#define _PARSER_H_
#include "ftpp.h" //这里等于包含来自己
ftpp.h:
================
#ifndef _FTPP_H
#define _FTPP_H
#include "sockwrapper.h"
#include "common.h"
#include "parser.h" //这里是错误包含,ftpp.h中用不到parser.h,如果ftpp.h中用到parser.h中定义到数据
//那么将parser.h中定义的部分放到ftpp.h中,
//然后将此条包含删除,避免循环包含!!!!!!!!!
#include <pthread.h>
parser.c:
================
#include "parser.h"
#include "sockwrapper.h"
#include <string.h>
++++++++++++++++++
有一个好习惯得养成,#include "" 最好写在#include<>的上面,这样写,可以避免很多问题。
- gcc:编译 expected declaration specifiers or ‘...’ before
- expected declaration specifiers or ‘...’ before
- expected declaration specifiers or '...' before string constant编译告警
- error: expected declaration specifiers or '...' before错误
- error: expected declaration specifiers or '...' before ***
- error expected declaration specifiers or ‘...’ before ‘SElemType’
- error: expected declaration specifiers or '...' before错误
- expected declaration specifiers or '...' before string constant
- error: expected declaration specifiers or ‘...’ before string constant
- 【错误】error: expected declaration specifiers or ‘...’ before string constant
- 【错误笔记】error: expected declaration specifiers or '...' before XXX
- error: expected declaration specifiers before ‘return’
- error: expected declaration specifiers or '...' before xxx(xxx是函数形参)
- 安装PHP时 jpeglib.h:954: error:expected declaration specifiers or ‘...’ before ‘FILE’ 错误解决
- /sysroot/usr/include/search.h:19: error: expected declaration specifiers or '...' before '__free_fn_
- /home/zhang/code/hello/hello.c:3: error: expected declaration specifiers or ‘...’ before string cons
- linux error: expected declaration specifiers or '...' XXX
- error: expected declaration specifiers or '...' 问题解决
- CUDA从入门到精通到精通_笔记5:GPU入门综述博文
- this,super关键字08
- react 组件的生命周期
- 植入支付宝遇到的坑
- ubuntu grub 操作
- gcc:编译 expected declaration specifiers or ‘...’ before
- mysql高并发注意事项
- 机器翻译
- 互斥信号量(mutex)
- 1188
- java正则表达式判断Email格式
- 笨小猴
- 开灯问题 c++
- AltiumDesigner PCB设计相关操作(实时更新)