- 论坛徽章:
- 0
|
机器环境:服务器A上AIX5.3 + gcc 4.2.0,服务器B上AIX6.1 + gcc 4.2.0
在编译一个动态库,这个动态库以前也是这么编译的,但是我接手后出现问题了,我在服务器B上运行测试程序的时候报错:libstdc++.so.6没有被找到,在服务器A上同样也是这样的错误。没有办法,我只能重新编译动态库源文件再测试,于是我在make clean的时候出现如下错误:make: Dependency line needs colon or double colon operator.
同样,make的时候出现如下错误:make: Cannot find a rule to create target = from dependencies.Stop.尝试了很多解决方案之后估计是makefile文件的问题,我把我的makefile文件贴出来:
#****************************************************************************
#
# Makefile for TinyXml test.
# Lee Thomason
# www.grinninglizard.com
#
# This is a GNU make (gmake) makefile
#****************************************************************************
# DEBUG can be set to YES to include debugging info, or NO otherwise
DEBUG := YES
# PROFILE can be set to YES to include profiling info, or NO otherwise
PROFILE := NO
# TINYXML_USE_STL can be used to turn on STL support. NO, then STL
# will not be used. YES will include the STL files.
TINYXML_USE_STL := YES
#****************************************************************************
CC := gcc
CXX := g++
LD := g++
AR := ar rc
RANLIB := ranlib
DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG
RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3
LIBS :=
DEBUG_CXXFLAGS := ${DEBUG_CFLAGS}
RELEASE_CXXFLAGS := ${RELEASE_CFLAGS}
DEBUG_LDFLAGS := -g
RELEASE_LDFLAGS :=
#ifeq (YES, ${DEBUG})
CFLAGS := ${DEBUG_CFLAGS}
CXXFLAGS := ${DEBUG_CXXFLAGS}
LDFLAGS := ${DEBUG_LDFLAGS}
else
CFLAGS := ${RELEASE_CFLAGS}
CXXFLAGS := ${RELEASE_CXXFLAGS}
LDFLAGS := ${RELEASE_LDFLAGS}
endif
ifeq (YES, ${PROFILE})
CFLAGS := ${CFLAGS} -pg -O3
CXXFLAGS := ${CXXFLAGS} -pg -O3
LDFLAGS := ${LDFLAGS} -pg
endif
#****************************************************************************
# Preprocessor directives
#****************************************************************************
ifeq (YES, ${TINYXML_USE_STL})
DEFS := -DTIXML_USE_STL
else
DEFS :=
endif
#****************************************************************************
# Include paths
#****************************************************************************
#INCS := -I/usr/include/g++-2 -I/usr/local/include
INCS :=
#****************************************************************************
# Makefile code common to all platforms
#****************************************************************************
CFLAGS := ${CFLAGS} ${DEFS}
CXXFLAGS := ${CXXFLAGS} ${DEFS}
#****************************************************************************
# Targets of the build
#****************************************************************************
OUTPUT := libUnicomH2Dll.so
all: ${OUTPUT}
#****************************************************************************
# Source files
#****************************************************************************
SRCS := APL_Poll.cpp tinyxml.cpp tinyxmlparser.cpp tinyxmlerror.cpp tinystr.cpp BaseElement.cpp BaseDataDef.cpp CustomElement.cpp BaseList.cpp DBPublic.cpp HeadField.cpp PackField.cpp H2Services.cpp HeadFieldList.cpp PackFieldList.cpp ServiceBody.cpp ServiceBodyList.cpp ServiceHead.cpp ServiceHeadList.cpp StringUtil.cpp UniVar.cpp UniVarList.cpp UnicomH2Dll.cpp PubSockCOmm.cpp SocketComm.cpp ThreadLock.cpp CReadConfig.cpp
# Add on the sources for libraries
SRCS := ${SRCS}
OBJS := $(addsuffix .o,$(basename ${SRCS}))
#****************************************************************************
# Output
#****************************************************************************
${OUTPUT}: ${OBJS}
echo -----read out-----------
${LD} -shared -lpthread -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
# @mv ${OUTPUT} ${HOME}/icddir/lib/
#****************************************************************************
# common rules
#****************************************************************************
# Rules for compiling source files to object files
%.o : %.cpp
${CXX} -c ${CXXFLAGS} ${INCS} $< -o $@
%.o : %.c
${CC} -c ${CFLAGS} ${INCS} $< -o $@
dist:
bash makedistlinux
clean:
-rm -f core ${OBJS} ${OUTPUT}
depend:
#makedepend ${INCS} ${SRCS}
#tinyxml.o: tinyxml.h tinystr.h
#tinyxmlparser.o: tinyxml.h tinystr.h
#xmltest.o: tinyxml.h tinystr.h
#tinyxmlerror.o: tinyxml.h tinystr.h
希望能在cu上得到解决,比较急,这里先谢谢各位高人了! |
|