当我运行一个make文件时,我得到了这个错误
“obj/viojournal.o:文件无法识别:文件格式无法识别 collect2:ld 返回 1 退出状态”
和make文件如下
如何解决这个问题。我在 centos 5.4 linx 64bit 机器上使用 gcc 编译器。
all: libvioft.so fdump syncer
CPPFLAGS = -I/usr/include/libxml2 -I../clogger -I../marshall -I../ddp \
-I../http -I../xml -I../nfsop -I../include/common -I../restful \
-I../include/oneGrid
CFLAGS = -g3 -Wall -Wextra -fPIC -DREPLICATION_ENABLED -DJOURNALING_ENABLED
#CFLAGS = -g3 -Wall -Wextra -fPIC
LDFLAGS = -Wl,-rpath=\$$ORIGIN -Wl,-rpath=\$$ORIGIN/../clogger \
-Wl,-rpath=\$$ORIGIN/../marshall -Wl,-rpath=\$$ORIGIN/../ddp \
-Wl,-rpath=\$$ORIGIN/../http -Wl,-rpath=\$$ORIGIN/../xml \
-Wl,-rpath=\$$ORIGIN/../restful
LIBS = -lpthread -lssl -lxml2 -lbz2 -L../clogger -lclogger \
-L../marshall -lmarshall -L../ddp -lddp -L../nfsop -lnfsop
libsources = filefs.c viojournal.c recvReplicaUpdate.c syncer.c hostops.c filetable.c updateRemoteFT.c checkpoint.c
#libsources = filefs.c viojournal.c hostops.c filetable.c checkpoint.c container.c locks.c
libobjects = $(libsources:%.c=obj/%.o)
fttestsources = fttest2.c
fttestobjects = $(fttestsources:%.c=obj/%.o)
syncersources = syncer.c
syncerobjects = $(syncersources:%.c=obj/%.o)
#dmpsources = viodump.c hostops.c
#dmpobjects = $(dmpsources:%.c=obj/%.o)
libvioft.so: $(libobjects)
$(CC) $(CFLAGS) -shared -o libvioft.so $(libobjects)
fdump: $(fttestobjects) libvioft.so
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o fdump $(fttestobjects)
syncer: $(syncerobjects) libvioft.so
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o syncer $(syncerobjects)
viodump: $(dmpobjects)
$(CC) $(CFLAGS) $(LDFLAGS) -lpthread -o viodump $(dmpobjects)
clean:
rm -rf fttest viodump atar syncer libvioft.so obj
install:
cp -f libvioft.so ../package/lib
# cp -f syncer ../package/bin
obj/%.d: %.c
$(SHELL) -ec 'mkdir -p obj && $(CC) -MM $(CPPFLAGS) $(CFLAGS) -MT $(@:.d=.o) -MT $@ $< > $@'
obj/%.o: %.c
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
include $(libsources:%.c=obj/%.d)
include $(tstsources:%.c=obj/%.d)
include $(atrsources:%.c=obj/%.d)
#include $(dmpsources:%.c=obj/%.d)