Stephen-Qin
  • VS2017配置使用#<pthread.h> https://blog.csdn.net/cry1994/article/details/79115394(原来SystemWow64里面存储的是32的文件.)
  • 配置后遇到的错误及解决方法:
    •   pthread.h中报错:C2011 “timespec”:“struct”类型重定义   
    • 解决方法:   在   #if !defined( PTHREAD_H )   #define PTHREAD_H   下面加上   define HAVE_STRUCT_TIMESPEC   这将告诉pthreads的,Win32头,你已经有一个适当的timespec,并会让你的代码编译正常。
    •   
    • 错误: 无法解析的外部符号 __imp__pthread_create,该符号在函数 _main 中被引用   
    • 解决方法:   在.cpp文件   #include <iostream>   #include <pthread.h>   using namespace std;   下边加上   #pragma comment(lib, "pthreadVC2.lib")//表示链接pthreadVC2.lib这个库。 和在工程设置里写上链入Ws2_32.lib的效果一样, 不过这种方法写的 程序别人在使用你的代码的时候就不用再设置工程settings了

 

分类:

技术点:

相关文章:

  • 2021-09-13
  • 2022-01-08
  • 2021-04-19
  • 2021-12-12
  • 2022-01-09
  • 2021-10-01
  • 2021-09-15
  • 2021-06-23
猜你喜欢
  • 2022-01-03
  • 2021-07-13
  • 2021-09-14
  • 2022-01-10
  • 2021-04-04
  • 2021-08-11
  • 2022-01-07
相关资源
相似解决方案