天嵌 ARM开发社区

 找回密码
 注册
查看: 2648|回复: 1

qtopia编译arm平台make时出错怎么解决啊?

[复制链接]
bensent 发表于 2010-6-15 22:35:16 | 显示全部楼层 |阅读模式
qtopia编译arm平台make时出错怎么解决啊?
出现如下错误:
[root@RAY first]# make
arm-linux-g++  -o /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/first first.o main.o  moc_first.o   -L/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/lib -L/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qt2/lib -lm -lqpe -lqtopia -lqte
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: first.o: Relocations in generic ELF (EM: 3)
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: first.o: Relocations in generic ELF (EM: 3)
first.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [/opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/first] Error 1
我的makefile代码如下:
#############################################################################
# Makefile for building first
# Generated by tmake at 21:43, 2010/06/15
#     Project: first
#    Template: app
#############################################################################

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

CC        =        arm-linux-gcc
CXX        =        arm-linux-g++
CFLAGS        =        -pipe -Wall -W -O2 -DNO_DEBUG
CXXFLAGS=        -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG
INCPATH        =        -I$(QTDIR)/include -I$(QPEDIR)/include
LINK        =        arm-linux-g++
LFLAGS        =       
LIBS        =        $(SUBLIBS) -L$(QPEDIR)/lib -L$(QTDIR)/lib -lm -lqpe -lqtopia -lqte
MOC        =        $(QTDIR)/bin/moc
UIC        =        $(QTDIR)/bin/uic

TAR        =        tar -cf
GZIP        =        gzip -9f

####### Files

HEADERS =        first.h
SOURCES =        first.cpp \
                main.cpp
OBJECTS =        first.o \
                main.o
INTERFACES =        first.ui
UICDECLS =        first.h
UICIMPLS =        first.cpp
SRCMOC        =        moc_first.cpp
OBJMOC        =        moc_first.o
DIST        =       
TARGET        =        $(QPEDIR)/image/opt/Qtopia/bin/first
DESKTOP =        $(QPEDIR)/image/opt/Qtopia/apps/EmbedSky/first.desktop
ICON =                $(QPEDIR)/image/opt/Qtopia/pics/first.png
INTERFACE_DECL_PATH = .

####### Implicit rules

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

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

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

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

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

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

####### Build rules


all: $(TARGET)
        cp -f first.desktop $(DESKTOP)
        cp -f first.png $(ICON)

$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
        $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)

moc: $(SRCMOC)

tmake: Makefile

Makefile: first.pro
        tmake first.pro -o Makefile

dist:
        $(TAR) first.tar first.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST)
        $(GZIP) first.tar

clean:
        -rm -f $(OBJECTS) $(OBJMOC) $(DESKTOP) $(ICON) $(TARGET)
        -rm -f *~ core

####### Sub-libraries


###### Combined headers


####### Compile

first.o: first.cpp \
                first.h \
                first.ui

main.o: main.cpp \
                first.h \
                /opt/EmbedSky/Qte/arm-qtopia-2.2.0/qtopia/include/qtopia/qpeapplication.h

first.h: first.ui
        $(UIC) first.ui -o $(INTERFACE_DECL_PATH)/first.h

first.cpp: first.ui
        $(UIC) first.ui -i first.h -o first.cpp

moc_first.o: moc_first.cpp \
                first.h

moc_first.cpp: first.h
        $(MOC) first.h -o moc_first.cpp
亚瑟王 发表于 2010-6-18 19:15:03 | 显示全部楼层
先make clean一下,然后再编译吧。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-6-19 20:41 , Processed in 2.036122 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表