当前位置: 技术问答>linux和unix
makefile的编写问题
来源: 互联网 发布时间:2016-01-06
本文导语: OBJECTS = hello.o main.o TARGET = main main: main.o hello.o g++ main.o hello.o -o main main.o: main.cpp g++ -c main.cpp -o main.o hello.o: hello.cpp hello.h g++ -c hello.cpp -o hello.o 上面是makefile的内容,为什么编译的时候老是报错?我...
OBJECTS = hello.o main.o
TARGET = main
main: main.o hello.o
g++ main.o hello.o -o main
main.o: main.cpp
g++ -c main.cpp -o main.o
hello.o: hello.cpp hello.h
g++ -c hello.cpp -o hello.o
上面是makefile的内容,为什么编译的时候老是报错?我的makefile文件,有什么问题,麻烦指出来,谢谢
linux:/home/cbtest/mytest # make -f ./makefile
./makefile:6: *** missing separator. Stop.
,
main.cpp中的内容如下,用到了hello.h
#include "hello.h"
#include
#include
using namespace std;
int main()
{
cout
TARGET = main
main: main.o hello.o
g++ main.o hello.o -o main
main.o: main.cpp
g++ -c main.cpp -o main.o
hello.o: hello.cpp hello.h
g++ -c hello.cpp -o hello.o
上面是makefile的内容,为什么编译的时候老是报错?我的makefile文件,有什么问题,麻烦指出来,谢谢
linux:/home/cbtest/mytest # make -f ./makefile
./makefile:6: *** missing separator. Stop.
,
main.cpp中的内容如下,用到了hello.h
#include "hello.h"
#include
#include
using namespace std;
int main()
{
cout