vs2019上跑一个很简单的多线程程序,这个代码很简单
#include <iostream>
#include <pthread.h>
using namespace std;
void* thread_fun(void*)
{
int a = 1;
int b = 2;
cout << a+b << endl;
return NULL;
}
int main()
{
pthread_t tid;
unsigned int data = 56;
int tret = pthread_create(&tid,NULL,thread_fun,&data);
}
诡异的是我Debug模式下运行的就好好的,但是Release版本下运行就会出现对pthread_create的未定义使用,这是为什么呀