commands commence before first target. 报错
来源:互联网 发布:exchange邮箱域名 编辑:程序博客网 时间:2024/06/05 19:30
在写好makefile 文件后 用make -f filename 命令进行编译的时候报错
原因是makefile 格式不正确。
改正后的写法:
myapp: main.o 2.o 3.o
gcc -o myapp main.o 2.o 3.o
main.o: main.c a.h
gcc -o main.c
2.o: 2.c a.h b.h
gcc -o 2.c
3.o: 3.c b.h c.h
gcc -o 3.c
要求是在写依赖关系的时候,要先写目标的名称,紧跟着一个冒号(:),接着是空格或者是制表符(tab),最后用空格或者制表符分割文件列表。
之后再进行编译通过。
运行文件:
更新b.h 头文件
会更新包含了b.h头文件的部分
删除 2.0
会重新的生成2.o 并更新需要用到2.o的地方
源代码:
main.c
#include <stdio.h>
#include <stdlib.h>
#include "a.h"
extern void function_two();
extern void function_three();
int main(){
printf("hello world main ! \n");
function_two();
function_three();
}
2.c
#include <stdio.h>
#include "a.h"
#include "b.h"
void function_two(){
printf("hello world fun 2 ! \n");
}
3.c
#include <stdio.h>
#include "b.h"
#include "c.h"
void function_three(){
printf("hello world fun three ! \n");
}
- commands commence before first target. 报错
- commands commence before first target
- commands commence before first target
- commands commence before first target
- commands commence before first target
- commands commence before first target
- g++编译报错原因分析 makefile : *** commands commence before first target. stop.
- Makefile错误:commands commence before first target.
- commands commence before first target. Stop.
- commands commence before first target makefile
- 编译错误:commands commence before first target
- make:commands commence before first target
- error: commands commence before first target
- Android编译时出现“commands commence before first target”
- makefile编译时候出现:commands commence before first target
- frameworks/base/Android.mk:135: *** commands commence before first target. Stop.
- Disksim 4.0 + SSD-extention make编译时出现错误 “ **commands commence before first target. Stop.”
- 【Cocos2d-x游戏开发】编译时出现 commands commence before first target
- python 检查邮箱是否有新邮件并邮件通知
- JQUERY中QUEUE和DEQUEUE
- HDU 5236 Article
- JavaWeb之Servlet
- Java之多线程下载
- commands commence before first target. 报错
- S是一个存放在数组中,长为n的字符串,试编写一个程序将S按下述要求改造后输出
- 常用的三种android分包规范
- Android 音量调节方法
- Android—Activity的四种启动模式
- 将栈S中的元素逆置,使用额外的一个栈L和非数组变量
- leetcode:Invert Binary Tree
- 已知s="(XYZ)+*",t="(X+Z)*Y",利用联接,求子串和转换等基本运算,将s转化为t
- leetcode[226]:Invert Binary Tree