__cdecl *转换出错
SDL中的代码代码:
void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);(在使用SDL时,原来的定义)
自己写的调用代码
class AudioStream
{
.....
SDL_AudioSpec wanted_spec
wanted_spec.callback=audio_callback;(回调函数)
void audio_callback(void *userdata, Uint8 *stream, int len)
{
}
};
编译时的出错信息:
D:\test\ffmpeg\code\LESSION3\first\test.cpp(281) : error C2440: '=' : cannot convert from 'void (__thiscall AudioStream::*)(void *,unsigned char *,int)' to 'void (__cdecl *)(void *,unsigned char *,int)'
如果不用类,那么没有问题。
请问如何解决这个问题?