[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2009-05-13
6
Medium Priority
?
3,785 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 400 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 11

Expert Comment

by:Todd Mummert
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:
Todd Mummert earned 1600 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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order for businesses to be compliant with certain information security laws in some countries, you need to be able to prove that a user (which user it was becomes important to the business to take action against the user after an event has occurr…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 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