求助:自己定义的头文件不能用---在线等

nihao_yangguang 2017-10-11 09:46:43
自己定义的头文件:
#ifndef _CLOCK_H_
#define _CLOCK_H_

struct Time {
int hour;
int munite;
int scecond;
};
void set(Time*p, int h, int m, int s);
void tick(Time*p);
void show(Time*p);
void run(Time*p);

#endif


引用时提示:
#include"clock.h"
无法打开源文件"clock.h"
...全文
541 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
9527 2017-10-16
  • 打赏
  • 举报
回复
不在include的path中,添加下
LEandLA 2017-10-13
  • 打赏
  • 举报
回复
引用 2楼我是你的主体 的回复:
跟C语言关键字应该不冲突,因为我的Time首字母是大写形式,我现在在前面加了下划线,依然无法解决这个问题,急!
你在.c文件中是如何include包含的?
ooolinux 2017-10-12
  • 打赏
  • 举报
回复
你的头文件保存的文件名是否为 clock.h 并且在cpp文件同目录下?
nihao_yangguang 2017-10-12
  • 打赏
  • 举报
回复
跟C语言关键字应该不冲突,因为我的Time首字母是大写形式,我现在在前面加了下划线,依然无法解决这个问题,急!
hongss 2017-10-12
  • 打赏
  • 举报
回复
Time与系统关键字冲突,改一下就行了 另外,set也可能会冲突
#ifndef _CLOCK_H_
#define _CLOCK_H_

struct STime
{
	int hour;
	int munite;
	int scecond;
};

void Myset(STime *p, int h, int m, int s);
void tick(STime *p);
void show(STime *p);
void run(STime *p);

#endif

1,221

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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