簡體   English   中英

預期在'::'標記之前的構造函數,析構函數或類型轉換

[英]Expected constructor, destructor, or type conversion before '::' token

編譯文件時出現以下錯誤。

//Error
PluginDiskstats.cpp:107: error: expected constructor, destructor, or type conversion before '::' token
scons: *** [PluginDiskstats.o] Error 1



// destructor
~PluginDiskstats::PluginDiskstats() // line 107
{
    if (stream != NULL) {
        fclose(stream);
        stream = NULL;
    }
    hash_destroy(&DISKSTATS);
}



// header file

#ifndef __PLUGIN_DISKSTATS_H__
#define __PLUGIN_DISKSTATS_H__

#include <QObject>
#include "Hash.h"

class PluginDiskstats : public QObject {
    Q_OBJECT
    HASH DISKSTATS;
    FILE *stream;
    int ParseDiskstats();

    public:
    PluginDiskstats();
    ~PluginDiskstats();

    public slots:
    double Diskstats(QString arg1, QString arg2, double arg3);
};

#endif

將第107行更改為:

PluginDiskstats::~PluginDiskstats()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM