当前位置: 技术问答>linux和unix
makefile时报错
来源: 互联网 发布时间:2015-07-14
本文导语: redhat8下,执行makefile时报错如下: [sms@sms zhej]$ ./makefile ./makefile: line 1: ORACLE_HOME: command not found ./makefile: line 4: GCCFLAG: command not found c++: no input files ./makefile: line 6: Protocol.o: command not found ./makefile: line 8:...
redhat8下,执行makefile时报错如下:
[sms@sms zhej]$ ./makefile
./makefile: line 1: ORACLE_HOME: command not found
./makefile: line 4: GCCFLAG: command not found
c++: no input files
./makefile: line 6: Protocol.o: command not found
./makefile: line 8: ../obj/query.o: Permission denied
./makefile: line 9: Protocol.o: command not found
./makefile: line 10: -lmysqlclient: command not found
./makefile: line 11: ../include: is a directory
./makefile: line 12: ../baselib/libbaselib.a: Permission denied
./makefile: line 13: all:client-test: command not found
./makefile: line 1: OBJ: command not found
./makefile: line 14: testclient:testclient.o: command not found
./makefile: line 1: CC: command not found
./makefile: line 1: GCCFLAG: command not found
以上只是一部分,几乎每一行命令都要报错,而另外一个人在他的终端上执行,据说没问题,我感到很奇怪,请各位老大指点一下。为什么会报这样的错误。另,以前是没有这种问题的。makefile文件的内容如下:
[sms@sms zhej]$ cat makefile
MYSQLINCL=-I/usr/include/mysql
MYSQLLIB=-L/usr/lib/mysql
ORACLE_HOME=/u01/app/oracle/product/8.1.7
GCCFLAG = -g -O2 -L$(ORACLE_HOME)/lib -lclntsh -lm -pthread -ldl
CC= c++
OBJ=rtSGIP.o Protocol.o ../obj/plsql.o
../obj/query.o ../obj/dbapi.o
OBJSERV= ../obj/query.o ../obj/dbapi.o
OBJSMS= Protocol.o ../obj/plsql.o
COMMLIB= -lmysqlclient -lz -lnsl -ltcl
CMPPINC= ../include -I../baselib
CMPPLIB= ../baselib/libbaselib.a -lpthread
all:client-test server-test FeeTest test testclient
testclient:testclient.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o testclient testclient.o $(OBJ) $(CMPPLIB) $(COMMLIB)
test:test.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o test test.o $(OBJ) $(CMPPLIB) $(COMMLIB)
FeeTest:FeeTest.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o FeeTest FeeTest.o $(OBJ) $(CMPPLIB) $(COMMLIB)
client-test:client.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o client-test client.o $(OBJ) $(CMPPLIB) $(COMMLIB)
server-test:server.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o server-test server.o $(OBJ) $(CMPPLIB) $(COMMLIB)
client.o:client.cpp
$(CC) $(GCCFLAG) $(GCCFLAG) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) client.cpp
test.o:test.cc
$(CC) $(GCCFLAG) $(GCCFLAG) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) test.cc
testclient.o:testclient.cc
$(CC) $(GCCFLAG) $(GCCFLAG) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) testclient.cc
server.o:server.cpp
$(CC) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) server.cpp
rtSGIP.o:rtSGIP.cpp rtSGIP.h
$(CC) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) rtSGIP.cpp
Protocol.o:Protocol.cc
$(CC) $(GCCFLAG) -I$(CMPPINC) $(MYSQLINCL) -c Protocol.cc $(CMPPLIB)
FeeTest.o:FeeTest.cc
$(CC) $(GCCFLAG) -I$(CMPPINC) $(MYSQLINCL) -c FeeTest.cc $(CMPPLIB)
[sms@sms zhej]$ ./makefile
./makefile: line 1: ORACLE_HOME: command not found
./makefile: line 4: GCCFLAG: command not found
c++: no input files
./makefile: line 6: Protocol.o: command not found
./makefile: line 8: ../obj/query.o: Permission denied
./makefile: line 9: Protocol.o: command not found
./makefile: line 10: -lmysqlclient: command not found
./makefile: line 11: ../include: is a directory
./makefile: line 12: ../baselib/libbaselib.a: Permission denied
./makefile: line 13: all:client-test: command not found
./makefile: line 1: OBJ: command not found
./makefile: line 14: testclient:testclient.o: command not found
./makefile: line 1: CC: command not found
./makefile: line 1: GCCFLAG: command not found
以上只是一部分,几乎每一行命令都要报错,而另外一个人在他的终端上执行,据说没问题,我感到很奇怪,请各位老大指点一下。为什么会报这样的错误。另,以前是没有这种问题的。makefile文件的内容如下:
[sms@sms zhej]$ cat makefile
MYSQLINCL=-I/usr/include/mysql
MYSQLLIB=-L/usr/lib/mysql
ORACLE_HOME=/u01/app/oracle/product/8.1.7
GCCFLAG = -g -O2 -L$(ORACLE_HOME)/lib -lclntsh -lm -pthread -ldl
CC= c++
OBJ=rtSGIP.o Protocol.o ../obj/plsql.o
../obj/query.o ../obj/dbapi.o
OBJSERV= ../obj/query.o ../obj/dbapi.o
OBJSMS= Protocol.o ../obj/plsql.o
COMMLIB= -lmysqlclient -lz -lnsl -ltcl
CMPPINC= ../include -I../baselib
CMPPLIB= ../baselib/libbaselib.a -lpthread
all:client-test server-test FeeTest test testclient
testclient:testclient.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o testclient testclient.o $(OBJ) $(CMPPLIB) $(COMMLIB)
test:test.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o test test.o $(OBJ) $(CMPPLIB) $(COMMLIB)
FeeTest:FeeTest.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o FeeTest FeeTest.o $(OBJ) $(CMPPLIB) $(COMMLIB)
client-test:client.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o client-test client.o $(OBJ) $(CMPPLIB) $(COMMLIB)
server-test:server.o $(OBJ)
$(CC) $(GCCFLAG) $(MYSQLLIB) -o server-test server.o $(OBJ) $(CMPPLIB) $(COMMLIB)
client.o:client.cpp
$(CC) $(GCCFLAG) $(GCCFLAG) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) client.cpp
test.o:test.cc
$(CC) $(GCCFLAG) $(GCCFLAG) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) test.cc
testclient.o:testclient.cc
$(CC) $(GCCFLAG) $(GCCFLAG) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) testclient.cc
server.o:server.cpp
$(CC) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) server.cpp
rtSGIP.o:rtSGIP.cpp rtSGIP.h
$(CC) $(GCCFLAG) -I$(CMPPINC) -c $(MYSQLINCL) rtSGIP.cpp
Protocol.o:Protocol.cc
$(CC) $(GCCFLAG) -I$(CMPPINC) $(MYSQLINCL) -c Protocol.cc $(CMPPLIB)
FeeTest.o:FeeTest.cc
$(CC) $(GCCFLAG) -I$(CMPPINC) $(MYSQLINCL) -c FeeTest.cc $(CMPPLIB)
|
[sms@sms zhej]$ ./makefile ----- what's this?
makefile是给make命令来处理的.所以你需要执行的是make
[sms@sms zhej]$ make
makefile是给make命令来处理的.所以你需要执行的是make
[sms@sms zhej]$ make
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。