gpt4 book ai didi

c++ - 为什么 QMutex 未知?

转载 作者:行者123 更新时间:2023-11-27 22:31:22 25 4
gpt4 key购买 nike

我已经包含了 QMutex header 并使用它,如下所示。但是我收到以下错误:

error C2146: syntax error : missing > ';' before identifier > '_RecorderParamsMutex'

error C4430: missing type specifier - int assumed. > Note: C++ does not support default-int

error C4430: missing type specifier -> int assumed. Note: C++ does not > support default-int

#ifndef RECORDERinterface_h
#define RECORDERinterface_h
#include "qstring.h"
#include "ccc.h"
#include "ddd.h"
#include <qmutex.h>
#include "eee.h"

using namespace Common; //for aaaaa

class RecorderInterface{
//the implemented recorders are my friends, the may access all my private stuff :)
friend class A;
friend class B;

public:
RecorderInterface();
bool setParam(RecorderPrintParam *up);


private:
QMutex _RecorderParamsMutex;
};

#endif

最佳答案

查看 header file ,类声明由#ifdef 包装。像这样尝试:

#define QT_THREAD_SUPPORT
#include <qmutex.h>

这可能应该是项目级的#define,以便其他线程定义也可用。

关于c++ - 为什么 QMutex 未知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2101362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com