用pthreadVC2.dll编写多线程程序一直报错 error C2065: “pthread_t ”: 未声明的标识符,为什么

#include "errno.h"
#include "pthread.h"
#include "stdafx.h"
#include

#include "lock.h"

class MyClass: public InstanceLockBase
{} ;
MyClass mc;
void pthread_join();
void pthread_create();
extern "C" static DWORD WINAPI CreateOnceProcess(LPVOID pArg)

{

   pthread_t t0;
   pthread_t t1;
       if (pthread_create(&t0,NULL,ThreadProcNet,NULL) ==-1)
       error(_T("无法重新启动"));
     Sleep(10000);
   InstanceLock il( & mc);  //加互斥锁

     if (pthread_create(&t1,NULL,ThreadProcNetNew,NULL) ==-1)
       error(_T("无法重新启动"));
      Sleep(10000);
        InstanceLock li( & mc);  //加互斥锁

pthread_t t2;

   if (pthread_create(&t2,NULL,ThreadProcNet,NULL) ==-1)
       {    SetThreadPriority(&t2,THREAD_PRIORITY_HIGHEST );
 error("请关闭文华财经wh8_sp"); }

                       Sleep(10000);

   void *result;



   if (pthread_join(t2,&result) ==-1)
            error("请关闭文华财经wh8_sp");   



    return 0;

       if(pthread_join(t1,&result)==-1)
            error("请关闭文华财经wh8_sp");

               if(pthread_join(t0,&result)==-1)
    error("请关闭文华财经wh8_sp");
  return 0;

}
图片说明

希望能贴出完整的抓取代码,我是初学C++,谢谢!

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 这篇博客: Windows下C++使用pthread错误解决方法中的 三、丢失pthreadVC2.dll 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:

    在这里插入图片描述

    这是因为windows下缺少pthread的动态链接库,我们需要将解压包里面的.\pthreads-w32-2-9-1-release\Pre-built.2\dll\x86\pthreadVC2.dll放置到C:\Windows\SysWOW64下即可解决。

    如果放置了解压包里面dll文件夹下x64的pthreadVC2.dll就会出现错误
    应用程序无法正常启动0xc000007b


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^