I am trying to use a pthread library.
What is the cause of this error?
error C2664: 'pthread_create' : cannot convert parameter 3 from 'void *(__clrcall *)(void *)' to 'void *(__cdecl *)(void *)
Here's my code:
pthread_create(&thread1,NULL,sub_m,(void *)data);
void *sub_m(void* data)
__clrcallin your error message makes me think the type of C++ project is Managed C++, not Native C++. Are you planning to use .NET Framework in your project? Actually, the solution provided by @toast should work, but disabling C++/CLI support (provided you don't need it) will not require to specify call convention explicitly.