• 6805阅读
  • 3回复

make编译出错,求救,各位请看看内容。 [复制链接]

上一主题 下一主题
离线浮银流光
 

只看楼主 正序阅读 楼主  发表于: 2009-12-02
我已经将qte4.5.3编译过了,

也配置了环境变量,现在想使用这个交叉环境生成板子下面的可执行文件,但是报错,大家请帮我看看

错误信息:
wqxu@wqxu-desktop:~/qt_workspace/example$ qmake -project
wqxu@wqxu-desktop:~/qt_workspace/example$ qmake
wqxu@wqxu-desktop:~/qt_workspace/example$ make
arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/qws/linux-arm-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include -I. -I. -o hello.o hello.cpp
arm-linux-g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -o example hello.o    -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lQtGui -L/home/wqxu/tslib/lib -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lts -lpng -L/usr/local/Trolltech/Qt-4.5.3/lib -lQtNetwork -lz -lQtCore -lm -lrt -ldl -lpthread
/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtGui.so when searching for -lQtGui
/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: skipping incompatible /usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtGui.so when searching for -lQtGui
/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: skipping incompatible /usr/local/Trolltech/Qt-4.5.3/lib/libQtGui.so when searching for -lQtGui
/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: skipping incompatible /usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/libQtGui.so when searching for -lQtGui
/usr/local/arm/3.4.1/bin/../lib/gcc/arm-linux/3.4.1/../../../../arm-linux/bin/ld: cannot find -lQtGui
collect2: ld returned 1 exit status
make: *** [example] Error 1




我的MAKEFILE也在下面贴出来给大家看看。。。

#############################################################################
# Makefile for building: example
# Generated by qmake (2.01a) (Qt 4.5.3) on: ?? 12? 2 12:47:46 2009
# Project:  example.pro
# Template: app
# Command: /usr/local/Trolltech/QtEmbedded-4.5.3-arm/bin/qmake -unix -o Makefile example.pro
#############################################################################

####### Compiler, tools and options

CC            = arm-linux-gcc
CXX           = arm-linux-g++
DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
INCPATH       = -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/qws/linux-arm-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include/QtNetwork -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.3-arm/include -I. -I.
LINK          = arm-linux-g++
LFLAGS        = -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib
LIBS          = $(SUBLIBS)  -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lQtGui -L/home/wqxu/tslib/lib -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lts -lpng -L/usr/local/Trolltech/Qt-4.5.3/lib -lQtNetwork -lz -lQtCore -lm -lrt -ldl -lpthread
AR            = arm-linux-ar cqs
RANLIB        =
QMAKE         = /usr/local/Trolltech/QtEmbedded-4.5.3-arm/bin/qmake
TAR           = tar -cf
COMPRESS      = gzip -9f
COPY          = cp -f
SED           = sed
COPY_FILE     = $(COPY)
COPY_DIR      = $(COPY) -r
INSTALL_FILE  = install -m 644 -p
INSTALL_DIR   = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE      = rm -f
SYMLINK       = ln -sf
DEL_DIR       = rmdir
MOVE          = mv -f
CHK_DIR_EXISTS= test -d
MKDIR         = mkdir -p

####### Output directory

OBJECTS_DIR   = ./

####### Files

SOURCES       = hello.cpp
OBJECTS       = hello.o
DIST          = /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/g++.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/unix.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/linux.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/qws.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/qconfig.pri \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt_functions.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt_config.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/exclusive_builds.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/default_pre.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/release.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/default_post.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/warn_on.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/unix/thread.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/moc.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/resources.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/uic.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/yacc.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/lex.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/include_source_dir.prf \
        example.pro
QMAKE_TARGET  = example
DESTDIR       =
TARGET        = example

first: all
####### Implicit rules

.SUFFIXES: .o .c .cpp .cc .cxx .C

.cpp.o:
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.cc.o:
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.cxx.o:
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.C.o:
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"

.c.o:
    $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"

####### Build rules

all: Makefile $(TARGET)

$(TARGET):  $(OBJECTS)  
    $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)

Makefile: example.pro  /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/qws/linux-arm-g++/qmake.conf /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/g++.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/unix.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/linux.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/qws.conf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/qconfig.pri \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt_functions.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt_config.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/exclusive_builds.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/default_pre.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/release.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/default_post.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/warn_on.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/unix/thread.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/moc.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/resources.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/uic.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/yacc.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/lex.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/include_source_dir.prf \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtGui.prl \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtNetwork.prl \
        /usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtCore.prl
    $(QMAKE) -unix -o Makefile example.pro
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/g++.conf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/unix.conf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/linux.conf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/common/qws.conf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/qconfig.pri:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt_functions.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt_config.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/exclusive_builds.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/default_pre.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/release.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/default_post.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/warn_on.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/qt.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/unix/thread.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/moc.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/resources.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/uic.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/yacc.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/lex.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/mkspecs/features/include_source_dir.prf:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtGui.prl:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtNetwork.prl:
/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib/libQtCore.prl:
qmake:  FORCE
    @$(QMAKE) -unix -o Makefile example.pro

dist:
    @$(CHK_DIR_EXISTS) .tmp/example1.0.0 || $(MKDIR) .tmp/example1.0.0
    $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/example1.0.0/ && $(COPY_FILE) --parents hello.cpp .tmp/example1.0.0/ && (cd `dirname .tmp/example1.0.0` && $(TAR) example1.0.0.tar example1.0.0 && $(COMPRESS) example1.0.0.tar) && $(MOVE) `dirname .tmp/example1.0.0`/example1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/example1.0.0


clean:compiler_clean
    -$(DEL_FILE) $(OBJECTS)
    -$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
    -$(DEL_FILE) $(TARGET)
    -$(DEL_FILE) Makefile


mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all

compiler_moc_header_make_all:
compiler_moc_header_clean:
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
    -$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean:

####### Compile

hello.o: hello.cpp
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o hello.o hello.cpp

####### Install

install:   FORCE

uninstall:   FORCE

FORCE:

离线浮银流光

只看该作者 3楼 发表于: 2009-12-03
算了,还是自己结帖子把

问题解决了,是因为之前交叉编译出了问题,生成的lib不是ARM的,而是X86的,谢谢各位大大进来看了,呵呵
离线浮银流光

只看该作者 2楼 发表于: 2009-12-03
我发觉MAKEFILE中的如下话将lQtGui注释掉的话就没问题了,但是后面就编译不过去,报别的错误。。。

LIBS          = $(SUBLIBS)  -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lQtGui -L/home/wqxu/tslib/lib -L/usr/local/Trolltech/QtEmbedded-4.5.3-arm/lib -lts -lpng -L/usr/local/Trolltech/Qt-4.5.3/lib -lQtNetwork -lz -lQtCore -lm -lrt -ldl -lpthread
离线浮银流光

只看该作者 1楼 发表于: 2009-12-02
在使用qt-x11作为环境变量下编译是可以通过并生成HELLO QT~!字样的,最简单的一个程序了。
快速回复
限100 字节
 
上一个 下一个