天嵌 ARM开发社区

 找回密码
 注册
查看: 1824|回复: 4

关于QT手册第四章,练习时出现的问题,请帮忙分析原因

[复制链接]
welenlee 发表于 2010-9-10 18:59:22 | 显示全部楼层 |阅读模式
第四章编译出现如下错误:
# make
Makefile:132: warning: overriding commands for target `moc_netset.cpp'
Makefile:129: warning: ignoring old commands for target `moc_netset.cpp'
arm-linux-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
In file included from netset.cpp:9:
netset.h:112: error: multiple types in one declaration
make: *** [netset.o] Error 1


netset.h文件如下:
/****************************************************************************
** Form interface generated from reading ui file 'netset.ui'
**
** Created: Fri Sep 10 18:22:22 2010
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef NETSETUP_H
#define NETSETUP_H

#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QTabWidget;

struct NETCONFIG{
        char usecdma;
        char nettype;
        const char* ipaddr;
        const char* netmask;
        const char* gateway;
        const char* dns;
        const char* mac;
        const char* netname;
        const char* password;
}

class netsetup : public QWidget
{
    Q_OBJECT

public:
    netsetup( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~netsetup();

    QTabWidget* tab;
    QWidget* netinfo;
    QGroupBox* Network_info;
    QLabel* IPAddr_T;
    QLabel* NetMask_T;
    QLabel* Gateway_T;
    QLabel* DNS_T;
    QLabel* MAC_T;
    QLineEdit* ip_info;
    QLineEdit* mask_info;
    QLineEdit* gateway_info;
    QLineEdit* dns_info;
    QLineEdit* mac_info;
    QLabel* logo1;
    QPushButton* close1;
    QWidget* configure;
    QPushButton* close2;
    QButtonGroup* configure_group;
    QRadioButton* autoip;
    QRadioButton* cdmaconfig;
    QRadioButton* wificonfig;
    QRadioButton* userip;
    QLabel* logo2;
    QWidget* wifi;
    QLabel* logo3;
    QPushButton* set_1;
    QPushButton* close3;
    QGroupBox* wifi_set;
    QLabel* PassWord_T;
    QLineEdit* password;
    QLabel* NetName_T;
    QLineEdit* netname;
    QWidget* tcpip;
    QGroupBox* GroupBox3_2;
    QLabel* ipaddr;
    QLabel* netmask;
    QLabel* gateway_t;
    QLineEdit* ip;
    QLineEdit* mask;
    QLineEdit* gateway;
    QLabel* logo4;
    QPushButton* set_2;
    QPushButton* close4;
    QWidget* dns_mac;
    QLabel* logo5;
    QPushButton* set_3;
    QPushButton* close5;
    QGroupBox* dns_mac_set;
    QLabel* dns_t;
    QLineEdit* dns;
    QLabel* mac_t;
    QLineEdit* mac;

        NETCONFIG itselfNetConfig;

public slots:
        virtual void setNetConfigItem(const QString *,int);
        virtual void readNetConfigFile();
        virtual void writeNetConfigFile(char);

    virtual void autosetip();
    virtual void setipinfo();
    virtual void setwifi();
    virtual void usecdma();
    virtual void usersetip();
    virtual void usewifi();

};

#endif // NETSETUP_H

似乎与手册中的netset.h内容一致.
请帮忙分析下,是何原因!
谢谢!
天嵌_support1 发表于 2010-9-11 11:32:26 | 显示全部楼层
1# welenlee

struct NETCONFIG{
        char usecdma;
        char nettype;
        const char* ipaddr;
        const char* netmask;
        const char* gateway;
        const char* dns;
        const char* mac;
        const char* netname;
        const char* password;
};

括号后加个分号,这是手写的吧?
 楼主| welenlee 发表于 2010-9-11 12:38:56 | 显示全部楼层
谢谢版主.
我是按教材中的红色部分添加的.
可能";"忘敲了.
在ARM-qtopia-2.2.0中,现已编译正常.
谢谢版主.
wenshan231 发表于 2010-9-27 11:17:59 | 显示全部楼层
版主真耐心啊
kelvinjie 发表于 2010-9-27 23:31:16 | 显示全部楼层
看不懂这些代码的实质意义啊!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-9-27 23:33 , Processed in 1.015560 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

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