所以我正在尝试为 Visual C++(2012) 使用 pthread 库,但出现此错误error C4716: 'print_message' : must return a value
这是代码
#include "stdafx.h"
#include <iostream>
#include "pthread.h"
using namespace std;
void* print_message(void *)
{
cout << "Threading\n";
}
int main()
{
pthread_t t1;
pthread_create(&t1, NULL, print_message, NULL);
cout << "Hello";
void* result;
pthread_join(t1,&result);
return 0;
}