Solved

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

Posted on 2009-05-13
6
3,442 Views
Last Modified: 2013-12-06
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?
0
Comment
Question by:jl66
  • 2
  • 2
  • 2
6 Comments
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 100 total points
ID: 24381991
Hi,

This is not a known error. since the kernel 2.6.27.21-170.2.56.fc10.i686 is around nearly 3 months nobody reported something like that. Are you sure that all the necessary headers and develtools in place before you compile your kernel ?

Did you follow all the necessary steps before building?
http://korenofer.blogspot.com/2009/01/building-fedora-10-kernel.html

I hope this helps.

Cheers,
K.
0
 

Author Comment

by:jl66
ID: 24384105
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.  
0
 

Author Comment

by:jl66
ID: 24384155
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?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 11

Expert Comment

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

0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24426162
> 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


 
0
 
LVL 11

Accepted Solution

by:
climbgunks earned 400 total points
ID: 24426381

It looks like you're trying to compile the kernel module from the PLP book.   If that's the case, the API they're using is no more, replace the lines where you're getting errors above (they should match the first of each set below)...with the line below it.


- class_device_create(plp_kmem_class, NULL, plp_kmem_dev, NULL, "plp_kmem");
+ device_create(plp_kmem_class, NULL, plp_kmem_dev, "plp_kmem");


- class_device_destroy(plp_kmem_class, plp_kmem_dev);
+ device_destroy(plp_kmem_class, plp_kmem_dev);
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now