Re: Implicit declaration of printk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 6 Dec 2004 06:06:25 -0800 (PST), Alaios <alaios@xxxxxxxxx> wrote:
> Good morning. I face the following problem...
> 
> first.c: In function `initmodule':
> first.c:11: warning: implicit declaration of function
> `printk'
> 
> I have searched aroung google but nothing like my
> mistake.... I want to know what else to do except
> killing myself.

Hi Alaios, 

It's because you've misspelled the -D __KERNEL__ as -D __KERNEL when
you invoke gcc.

The printk declaration in kernel.h is protected by a #ifdef
__KERNEL__, and if you don't define that symbol at compile time, the
printk declaration won't get pulled in at compile time and the
compiler yells at you. But you knew that, right :-). It's just a bad
old typo.

Hope this helps :-)

Regards,
Karthik.
-- 
There are things known and things unknown, in between lie the Doors

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux