我正在使用带有 SDL 的 Visual Studio 2012,并且正在执行一个简单的线程任务,但我总是收到以下错误:
argument of type "int (mainGame::*)(void *ptr)" is incompatible with parameter of type "int (__cdecl *)(void *)"
我得到的另一个错误:
error C3867: 'mainGame::gameEvents': function call missing argument list; use '&mainGame::gameEvents' to create a pointer to member
函数是这样写的:
int gameEvents(void *ptr){
//do things here.
return 0;
}
这是我用来调用函数的代码:
SDL_Thread* gh;
gh = SDL_CreateThread(gameEvents,NULL);