我的makefile无法编译C程序

时间:2017-12-23 17:57:17

标签: c compilation ibm-mq

我有一个makefile

EXECUTABLE = $(ONLINE_HOME)/bin/fin2ici    
OBJECTS = $(ONLINE_HOME)/src/dte_mq.o \    
      $(ONLINE_HOME)/src/fin2ici.o    


#CC = /db/pub/infra/SUNWspro/6.2/SUNWspro/bin/cc -DMQ_SEND    
CC = /usr/vacpp/bin/cc -DMQ_SEND    

ALLINCL    =    -I$(ONLINE_HOME)/inc -I$(MQM_HOME)/inc -I$(ORACLE_HOME)/rdbms/public    

MQLIB =   -L${MQM_HOME}/ -lmqmcs -lmqmzse    

MYLIB = -L${ONLINE_HOME}/src/ -lmqm    

#ORALIB = -L${ORACLE_HOME}/lib32/ -lclntsh    
ORALIB = -L${ORACLE_HOME}/lib/ -lclntsh    
ALLLIB     =     $(MQLIB) \    
             $(ORALIB) \    
             $(MYLIB) \    
            -lsocket -lnsl -ldl    


CFLAGS     =    -g \    
            $(ALLINCL)    


all: $(EXECUTABLE)    

COMPILE.c =  $(CC)  $(CFLAGS)    


.SUFFIXES:       .o    
.c.o:    
    $(COMPILE.c) -c $*.c -o ${<:.c=.o}    

$(EXECUTABLE):  $(OBJECTS) $(LIB)    
    @echo Linking $(EXECUTABLE)        
    $(CC)  $(OBJECTS) -o  $(EXECUTABLE) $(ALLLIB)        


clean:        
    /bin/rm -rf $(OBJECTS) $(EXECUTABLE)        

depend: $(OBJS:.o=.h) $(OBJS:.o=.cpp) makefile.fin2ici        

当我运行它时,我收到一个错误:

$ make -f ./makefile.fin2ici
Linking /applications/dte/bin/fin2ici
    /usr/vacpp/bin/cc     -DMQ_SEND  /applications/dte/src/dte_mq.o  /applications/dte/src/fin2ici.o          -o  /applications/dte/bin/fin2ici -L/usr/mqm/ -lmqmcs -lmqmzse      -L/data/oracle/product/11.2.0.4.7/lib/ -lclntsh  -L/applications/dte/src/   -lmqm  -lsocket -lnsl -ldl       
ld: 0706-006 Cannot find or open library file: -l socket    
    ld:open(): No such file or directory    
: The error code from the last command is 255.   


Stop.
你帮忙找错了吗?

0 个答案:

没有答案