pthread_create invalid conversion from 'void (*)(void*)' to 'void* (*)(void*)'

编译报错:
test.cpp:526:75: error: invalid conversion from ‘void ()(void)’ to ‘void* ()(void)’ [-fpermissive]
pthread_create(&threah[i],0,encodeFileThread,(void*)&threadParm[i]);
^
In file included from test.cpp:6:0:
/home/yuan/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include/pthread.h:235:12: note: initializing argument 3 of ‘int pthread_create(pthread_t*, const pthread_attr_t*, void* ()(void), void*)’
extern int pthread_create (pthread_t *__restrict __newthread,
^
make: *** [test] 错误 1

原因:
参数3返回类型错误。
void encodeFileThread(void* arg)

解决方式:
修改为返回void指针。
void* encodeFileThread(void* arg)

你可能感兴趣的:(编译)