开发者社区> 问答> 正文

简单的makefile,我的代码如下,怎么make失败呢?,在num.c找不到coun函数

count.h
1 #ifndef COUNT_H
2 #define COUNT_H
3 int coun(int x);
4 #endif
count.c
1 #include“stdio.h”
2 int coun(int x)
3 {return (2*x);
}
num.c
1 #include"stdio.h"
2 #include"count.h"
3 int main()
4 {printf("%d\n",coun(1));
5 }
}
Makefile:
num : num.c count.h
make之后出错

展开
收起
杨冬芳 2016-07-12 16:44:45 1812 0
1 条回答
写回答
取消 提交回答
  • IT从业

    Makefile:

    num: num.c count.o

    %.o: %.c
    gcc -c $<

    2019-07-17 19:55:14
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载