天嵌 ARM开发社区

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

在编译qt(x86版)网络设置例子程序时提示错误,请亚瑟王给看看

[复制链接]
aohaisoft 发表于 2010-6-25 15:55:12 | 显示全部楼层 |阅读模式
本帖最后由 aohaisoft 于 2010-6-25 15:57 编辑

错误信息:
[root@EmbedSky netset]#
[root@EmbedSky netset]#
[root@EmbedSky netset]#
[root@EmbedSky netset]# make
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o netset.o netset.cpp
netset.cpp:230: declaration of `virtual void netsetup::showMess(int)' outside
   of class is not definition
netset.cpp:231: parse error before `{' token
netset.cpp: In member function `virtual void netsetup::setNetConfigItem(const
   QString*, int)':
netset.cpp:283: name lookup of `i' changed for new ISO `for' scoping
netset.cpp:239:   using obsolete binding at `i'
netset.cpp: In member function `virtual void
   netsetup::writeNetConfigFile(int)':
netset.cpp:374: `end1' undeclared (first use this function)
netset.cpp:374: (Each undeclared identifier is reported only once for each
   function it appears in.)
make: *** [netset.o] Error 1
[root@EmbedSky netset]#
 楼主| aohaisoft 发表于 2010-6-25 16:38:37 | 显示全部楼层
前面的经改正,已经不提示,但又出现新的提示:
[root@EmbedSky netset]# make
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o netset.o netset.cpp
netset.cpp: In member function `virtual void netsetup::showMess(int)':
netset.cpp:231: warning: unused parameter `int aa'
/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/bin/moc netset.h -o moc_netset.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/include -I/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/include -o moc_netset.o moc_netset.cpp
g++  -o /opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/netset main.o netset.o netset.o moc_netset.o moc_netset.o  -L/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/lib -L/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qt2/lib -lqpe -lqtopia -lqte
netset.o(.text+0x0): In function `netsetup::netsetup[not-in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `netsetup::netsetup[not-in-charge](QWidget*, char const*, unsigned)'
netset.o(.text+0x0): first defined here
netset.o(.text+0x4070): In function `netsetup::languageChange()':
: multiple definition of `netsetup::languageChange()'
netset.o(.text+0x4070): first defined here
netset.o(.text+0x2f4c): In function `netsetup::readNetConfigFile()':
: multiple definition of `netsetup::readNetConfigFile()'
netset.o(.text+0x2f4c): first defined here
netset.o(.text+0x1394): In function `netsetup::netsetup[in-charge](QWidget*, char const*, unsigned)':
: multiple definition of `netsetup::netsetup[in-charge](QWidget*, char const*, unsigned)'
netset.o(.text+0x1394): first defined here
netset.o(.text+0x2728): In function `netsetup::~netsetup [not-in-charge]()':
: multiple definition of `netsetup::~netsetup [not-in-charge]()'
netset.o(.text+0x2728): first defined here
netset.o(.text+0x274c): In function `netsetup::~netsetup [in-charge]()':
: multiple definition of `netsetup::~netsetup [in-charge]()'
netset.o(.text+0x274c): first defined here
netset.o(.text+0x2770): In function `netsetup::~netsetup [in-charge deleting]()':
: multiple definition of `netsetup::~netsetup [in-charge deleting]()'
netset.o(.text+0x2770): first defined here
netset.o(.text+0x279c): In function `netsetup::showMess(int)':
: multiple definition of `netsetup::showMess(int)'
netset.o(.text+0x279c): first defined here
netset.o(.bss+0x0): multiple definition of `ls'
netset.o(.bss+0x0): first defined here
netset.o(.bss+0x40): multiple definition of `rs'
netset.o(.bss+0x40): first defined here
netset.o(.text+0x27ac): In function `netsetup::setNetConfigItem(QString const*, int)':
: multiple definition of `netsetup::setNetConfigItem(QString const*, int)'
netset.o(.text+0x27ac): first defined here
netset.o(.text+0x35f0): In function `netsetup::writeNetConfigFile(int)':
: multiple definition of `netsetup::writeNetConfigFile(int)'
netset.o(.text+0x35f0): first defined here
netset.o(.text+0x4bd8): In function `netsetup::setwifi1()':
: multiple definition of `netsetup::setwifi1()'
netset.o(.text+0x4bd8): first defined here
netset.o(.text+0x4c0c): In function `netsetup::setipinfo()':
: multiple definition of `netsetup::setipinfo()'
netset.o(.text+0x4c0c): first defined here
netset.o(.text+0x4c40): In function `netsetup::usecdma()':
: multiple definition of `netsetup::usecdma()'
netset.o(.text+0x4c40): first defined here
netset.o(.text+0x4c68): In function `netsetup::usersetip()':
: multiple definition of `netsetup::usersetip()'
netset.o(.text+0x4c68): first defined here
netset.o(.text+0x4c90): In function `netsetup::usewifi()':
: multiple definition of `netsetup::usewifi()'
netset.o(.text+0x4c90): first defined here
netset.o(.text+0x4cb8): In function `netsetup::autosetip()':
: multiple definition of `netsetup::autosetip()'
netset.o(.text+0x4cb8): first defined here
netset.o(.text+0x4ce0): In function `netsetup::setmac()':
: multiple definition of `netsetup::setmac()'
netset.o(.text+0x4ce0): first defined here
moc_netset.o(.text+0x0): In function `netsetup::className() const':
: multiple definition of `netsetup::className() const'
moc_netset.o(.text+0x0): first defined here
moc_netset.o(.data+0x0): multiple definition of `netsetup::metaObj'
moc_netset.o(.data+0x0): first defined here
moc_netset.o(.text+0xc): In function `netsetup::initMetaObject()':
: multiple definition of `netsetup::initMetaObject()'
moc_netset.o(.text+0xc): first defined here
moc_netset.o(.text+0xcc): In function `netsetup::staticMetaObject()':
: multiple definition of `netsetup::staticMetaObject()'
moc_netset.o(.text+0xcc): first defined here
moc_netset.o(.text+0x74): In function `netsetup::tr(char const*)':
: multiple definition of `netsetup::tr(char const*)'
moc_netset.o(.text+0x74): first defined here
moc_netset.o(.text+0xa0): In function `netsetup::tr(char const*, char const*)':
: multiple definition of `netsetup::tr(char const*, char const*)'
moc_netset.o(.text+0xa0): first defined here
collect2: ld returned 1 exit status
make: *** [/opt/EmbedSky/Qte/x86-qtopia-2.2.0/qtopia/image/opt/Qtopia/bin/netset] Error 1
[root@EmbedSky netset]#
 楼主| aohaisoft 发表于 2010-6-25 16:56:11 | 显示全部楼层
自己解决了。这是我总结的两点,请亚瑟老大看看对不对:
1.每次在重新生成Makefile时都要在Qte目录下执行source setX86_QpeEnv设置环境变量
2.在Makefile中应注意:
####### Files

HEADERS =        netset.h
SOURCES =        main.cpp \
                netset.cpp
OBJECTS =        main.o \
                netset.o
INTERFACES =        netset.ui
UICDECLS =        netset.h
UICIMPLS =        netset.cpp
SRCMOC        =        moc_netset.cpp
OBJMOC        =        moc_netset.o
DIST        =       
中也有重复的需要清除。
亚瑟王 发表于 2010-6-26 19:21:49 | 显示全部楼层
第一条不需要,只要在同一个终端中设置过了环境变量就行了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-6-18 00:15 , Processed in 1.078125 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

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