编写了.h和.c文件,准备生成SO文件报错如下:

lgmsyy 2014-03-18 11:20:00
Test.h
struct DETECTION_STRUCT
{
int nLeft;
int nRight;

};


int testFromBuffer(int imgSize, DETECTION_STRUCT *candi);

-----------------------------------------
Test.c
int testFromBuffer(int imgSize,DETECTION_STRUCT *candi){
.......

return 0;
}



In file included from Test.c:5:
Test.h:8: error: expected declaration specifiers or ‘...’ before ‘DETECTION_STRUCT’
Test.c:20: error: expected declaration specifiers or ‘...’ before ‘DETECTION_STRUCT’
...全文
172 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lgmsyy 2014-03-18
  • 打赏
  • 举报
回复
是没有引入#include <stdbool.h>
引用 4 楼 tuzhutuzhu 的回复:
[quote=引用 3 楼 lgmsyy 的回复:] [quote=引用 1 楼 tuzhutuzhu 的回复:] DETECTION_STRUCT *candi-->struct DETECTION_STRUCT *candi
int testFromBuffer(int imgSize, struct DETECTION_STRUCT *candi);这个更改没问题了,但是我又加入一个布尔类型,怎么还报之前的错误呢 int testFromBuffer(int imgSize, struct DETECTION_STRUCT *candi,bool flag);[/quote] 代码跟编译报的错贴上来看看[/quote]
tuzhutuzhu 2014-03-18
  • 打赏
  • 举报
回复
引用 3 楼 lgmsyy 的回复:
[quote=引用 1 楼 tuzhutuzhu 的回复:] DETECTION_STRUCT *candi-->struct DETECTION_STRUCT *candi
int testFromBuffer(int imgSize, struct DETECTION_STRUCT *candi);这个更改没问题了,但是我又加入一个布尔类型,怎么还报之前的错误呢 int testFromBuffer(int imgSize, struct DETECTION_STRUCT *candi,bool flag);[/quote] 代码跟编译报的错贴上来看看
lgmsyy 2014-03-18
  • 打赏
  • 举报
回复
引用 1 楼 tuzhutuzhu 的回复:
DETECTION_STRUCT *candi-->struct DETECTION_STRUCT *candi
int testFromBuffer(int imgSize, struct DETECTION_STRUCT *candi);这个更改没问题了,但是我又加入一个布尔类型,怎么还报之前的错误呢 int testFromBuffer(int imgSize, struct DETECTION_STRUCT *candi,bool flag);
赵4老师 2014-03-18
  • 打赏
  • 举报
回复
偶遇到类似问题都是用 “每次用/*...*/注释掉不同部分再重新编译,直到定位到具体语法出错的位置。” 的方法解决的。
tuzhutuzhu 2014-03-18
  • 打赏
  • 举报
回复
DETECTION_STRUCT *candi-->struct DETECTION_STRUCT *candi

69,374

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧