天嵌 ARM开发社区

 找回密码
 注册
查看: 2181|回复: 3

first实验 make时候出的错误

[复制链接]
wuywsy 发表于 2009-6-25 11:38:12 | 显示全部楼层 |阅读模式
make的时候出现这样的报错信息,不知道是什么问题
以下为报错信息:
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia/qt/include -I/opt/EmbedSky/Qte/x86-qtopia/qtopia/include -o first.o first.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia/qt/include -I/opt/EmbedSky/Qte/x86-qtopia/qtopia/include -o main.o main.cpp
/opt/EmbedSky/Qte/x86-qtopia/qt/bin/moc first.h -o moc_first.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia/qt/include -I/opt/EmbedSky/Qte/x86-qtopia/qtopia/include -o moc_first.o moc_first.cpp
gcc  -o first first.o main.o first.o moc_first.o moc_first.o  -L/opt/EmbedSky/Qte/x86-qtopia/qtopia/lib -L/opt/EmbedSky/Qte/x86-qtopia/qt/lib -lqpe -lqtopia -lqte
first.o(.text+0x0): In function `first::first[not-in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `first::first[not-in-charge](QWidget*, char const*, unsigned)'
first.o(.text+0x0): first defined here
first.o(.text+0x4cc): In function `first::languageChange()':
: multiple definition of `first::languageChange()'
first.o(.text+0x4cc): first defined here
first.o(.text+0x22c): In function `first::first[in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `first::first[in-charge](QWidget*, char const*, unsigned)'
first.o(.text+0x22c): first defined here
first.o(.text+0x458): In function `first::~first [not-in-charge]()':
: multiple definition of `first::~first [not-in-charge]()'
first.o(.text+0x458): first defined here
first.o(.text+0x47c): In function `first::~first [in-charge]()':
: multiple definition of `first::~first [in-charge]()'
first.o(.text+0x47c): first defined here
first.o(.text+0x4a0): In function `first::~first [in-charge deleting]()':
: multiple definition of `first::~first [in-charge deleting]()'
first.o(.text+0x4a0): first defined here
first.o(.text+0x604): In function `first::user_button()':
: multiple definition of `first::user_button()'
first.o(.text+0x604): first defined here
moc_first.o(.text+0x0): In function `first::className() const':
: multiple definition of `first::className() const'
moc_first.o(.text+0x0): first defined here
moc_first.o(.data+0x0): multiple definition of `first::metaObj'
moc_first.o(.data+0x0): first defined here
moc_first.o(.text+0xc): In function `first::initMetaObject()':
: multiple definition of `first::initMetaObject()'
moc_first.o(.text+0xc): first defined here
moc_first.o(.text+0xcc): In function `first::staticMetaObject()':
: multiple definition of `first::staticMetaObject()'
moc_first.o(.text+0xcc): first defined here
moc_first.o(.text+0x74): In function `first::tr(char const*)':
: multiple definition of `first::tr(char const*)'
moc_first.o(.text+0x74): first defined here
moc_first.o(.text+0xa0): In function `first::tr(char const*, char const*)':
: multiple definition of `first::tr(char const*, char const*)'
moc_first.o(.text+0xa0): first defined here
collect2: ld returned 1 exit status
make: *** [first] Error 1
 楼主| wuywsy 发表于 2009-6-25 11:39:50 | 显示全部楼层
我的makefile如下:
#############################################################################
# Makefile for building first
# Generated by tmake at 16:02, 2009/06/24
#     Project: first
#    Template: app
#############################################################################

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

CC        =        gcc
CXX        =        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        =        gcc
LFLAGS        =       
LIBS        =        $(SUBLIBS) -L$(QPEDIR)/lib -L$(QTDIR)/lib -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 \
                first.o
INTERFACES =        first.ui
UICDECLS =        first.h
UICIMPLS =        first.cpp
SRCMOC        =        moc_first.cpp
OBJMOC        =        moc_first.o
DIST        =       
TARGET        =        first
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)

$(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) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(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/x86-qtopia/qtopia/include/qtopia/qpeapplication.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/qpeglobal.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/qlibrary.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/qcom.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/quuid.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/qtopiawinexport.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/timestring.h \
                /opt/EmbedSky/Qte/x86-qtopia/qtopia/include/qtopia/applicationinterface.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
亚瑟王 发表于 2009-6-25 11:43:33 | 显示全部楼层
你没有按照手册说的做。在手册的38页和39页列出来了对应的Makefile文件,你对比一下你现在列出来的呢,里面有大量的重复信息,你没有删除。
 楼主| wuywsy 发表于 2009-6-25 13:02:27 | 显示全部楼层
问题解决了,谢谢:lol
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-4-20 07:32 , Processed in 1.046875 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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