私のプロジェクトをコンパイルしようとしていますが、次のエラーが表示されています。エラー: 'pthread'のタイプに名前がありません
コード:RESTServer.h
#ifndef __RESTSERVER__
#define __RESTSERVER__
#include <string>
#include <pthread.h>
using namespace std;
class RESTServer{
private:
RESTServer();
~RESTServer();
public:
static pthread *thread;
static void init_rest_server();
};
#endif
エラー:
RESTServer.h:14:10: error: ‘pthread’ does not name a type
static pthread *thread;
私はC++クラスのメンバーとしてのpthreadへのポインタを宣言しようとしています。誰も私をここで助けることができます。
pthreadsのドキュメントには、 'pthread'が型であることが記載されていますか? – hvd