Link to home
Start Free TrialLog in
Avatar of jl66
jl66Flag for United States of America

asked on

How to fix the linux kernel make error: implicit declaration of function class_device_create

When compiling code with make, I got the errors:
--------------------
make -C /lib/modules/`uname -r`/build modules M=$PWD
make: Entering directory `/usr/src/kernels/2.6.27.21-170.2.56.fc10.i686'
  CC [M]  /home/jeff/modules/plp_kmem/plp_kmem.o
/home/jeff/modules/plp_kmem/plp_kmem.c: In function plp_kmem_init:
/home/jeff/modules/plp_kmem/plp_kmem.c:193: error: implicit declaration of function class_device_create
/home/jeff/modules/plp_kmem/plp_kmem.c: In function plp_kmem_exit:
/home/jeff/modules/plp_kmem/plp_kmem.c:212: error: implicit declaration of function class_device_destroy
make[1]: *** [/home/jeff/modules/plp_kmem/plp_kmem.o] Error 1
make: *** [_module_/home/jeff/modules/plp_kmem] Error 2
make: Leaving directory `/usr/src/kernels/2.6.27.21-170.2.56.fc10.i686'
--------------
Can any expert shed some light on it?
SOLUTION
Avatar of Kerem ERSOY
Kerem ERSOY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jl66

ASKER

Thanks for the info.
I basically use yum to upgrade Fedora 10 to this release (instead of rpm in the link you recommended). I installed the original one from CDs downloaded from linux site. The issue here is that when I tried to compile an kernel book example, the errors occurred. I believe this example was well written. The error messages are not new. There are some hits on the net, but they are not detail enough, so I asked help from your experts.  
Avatar of jl66

ASKER

The most important lines in the compiling message seem  as follows:
----
error: implicit declaration of function 'class_device_create'
error: implicit declaration of function 'class_device_destroy'
----
There are some hits in the net. Is there anything I can do to fix this?
Avatar of Todd Mummert
Todd Mummert

the class_device_* api's  have long been deprecated.... now removed I guess.   Look at using device_create() instead.

> I basically use yum to upgrade Fedora 10 to this release (instead of rpm in the link you recommended). I
> installed the original one from CDs downloaded from linux site. The issue here is that when I tried to

If wht you mean is you had a previous release of FC and you've upgraded to this version you'll may be need to check your /etc/yum.d folder and look for any .rpmnew files there If you have them you'll need to remove the ones from the older version and and be replaced by the newere version.

I think you're may be getting the older versions when updating. then you do a yum clean and redo yum update before attempting to compile.

ans will you post the output of:
rpm -qa |grep kernel


 
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial