C++ pthread_create();类未在作用域中声明?

C++ pthread_create();类未在作用域中声明?,c++,pthreads,C++,Pthreads,我有一门课叫pos。。。我正在尝试从这个类中轮询一个方法。我使用了pthread_create(pthread_t thread,pos::Pirnt_data,this) 我得到一个错误,pos未在范围中声明。。。我包括了pos的h文件,但我不明白。我想我用错格式了有人能帮我吗 #include "position.h" #include "pthread.h" #include "pos.h" void position::tick(schedflags_t flags) {

我有一门课叫pos。。。我正在尝试从这个类中轮询一个方法。我使用了pthread_create(pthread_t thread,pos::Pirnt_data,this)

我得到一个错误,pos未在范围中声明。。。我包括了pos的h文件,但我不明白。我想我用错格式了有人能帮我吗

#include "position.h"
#include "pthread.h"
#include "pos.h"
void position::tick(schedflags_t flags) 
{   
    if(pthread_create(&thread,NULL,pos::Print_data,this)!=0) {
        stringstream bad;
        bad << "OPIMex: Could not create listener thread: "
    }
#包括“position.h”
#包括“pthread.h”
#包括“位置h”
无效位置::勾选(schedflags\u t标志)
{   
if(pthread_create(&thread,NULL,pos::Print_data,this)!=0){
溪流不好;
坏1)您可以提供一些代码片段/附加信息来帮助您更好地完成任务


2) 如果出现链接错误,请检查是否使用-lpthread库进行了链接。

从pos.h开始,似乎没有名为pos的类,您只需调用函数名:

 if(pthread_create(&thread,NULL,Print_data,this)!=0) {

pthread\u kill
未打开
pthread.
。它已打开
signal.h

#include <signal.h>
#包括

可能是这样,我会尝试一下,然后告诉您现在它出现了另一个错误,从'void()()'到'void()(void)的转换无效“PoS类在哪里?”所以代码> PrttPyDATA < /Cord>必须取<代码> Value*/Cuth>。这只是您要看到C++文件的头文件吗?@ Zyad No,他想查看<代码>类< <代码>代码> POS < /C> >的定义。必须在一个头文件中。或者你对
class
的含义感到困惑。我不理解你,你是说构造函数?
#include <signal.h>