繁体   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