模块加载时报错,unresolved symbol
我写了一个很简单的程序,用到了线程函数:
#define MODULE
#include<pthread.h>
#include<linux/module.h>
pthread_t thread;
void * thread_code()
{
while(1)
{
printk("Hello world!\n");
}
return 0;
}
int init_module(void)
{
return pthread_create(&thread,NULL,thread_code,NULL);
}
void cleanup_module(void)
{
printk("Good Bye\n");
}
编译可以通过,但加载的时候报错:
unresolved symbol pthread_create
然后有个hint,说:模块只能访问GPLONLY符合。
请问这种错误应该如何解决?