Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > implicit declaration of function???

Reply
Thread Tools

implicit declaration of function???

 
 
yeah
Guest
Posts: n/a
 
      09-14-2007
hi
I got this error "implicit declaration of function"
what it means???

 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      09-14-2007
yeah said:

> hi
> I got this error "implicit declaration of function"
> what it means???


You forgot to provide a prototype for a function within the scope
visible to the compiler at the point where it was compiling a call to
that function.

If it's a standard library function or a function from a third party
library (or indeed from your own library), include the appropriate
header.

If it's one of your own functions, copy the declarator to near the top
of the program, and bang a semicolon on the end of it. That should fix
the problem.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
 
 
 
yeah
Guest
Posts: n/a
 
      09-14-2007
On Sep 14, 6:04 pm, Richard Heathfield <(E-Mail Removed)> wrote:
> yeah said:
>
> > hi
> > I got this error "implicit declaration of function"
> > what it means???

>
> You forgot to provide a prototype for a function within the scope
> visible to the compiler at the point where it was compiling a call to
> that function.
>
> If it's a standard library function or a function from a third party
> library (or indeed from your own library), include the appropriate
> header.
>
> If it's one of your own functions, copy the declarator to near the top
> of the program, and bang a semicolon on the end of it. That should fix
> the problem.
>
> --
> Richard Heathfield <http://www.cpax.org.uk>
> Email: -www. +rjh@
> Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
> "Usenet is a strange place" - dmr 29 July 1999


thanks
The prototype for certain functions are missing in the header files.
Is it possible to download the particular functions from net and add
it to the program?

 
Reply With Quote
 
Joachim Schmitz
Guest
Posts: n/a
 
      09-14-2007
"yeah" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) ups.com...
> The prototype for certain functions are missing in the header files.
> Is it possible to download the particular functions from net and add
> it to the program?

A function is not the same as a prototype, a prototype merly describes (a
part of) the interface of a funtion (i.e. it's in- and output types).
A prototype (in some header) is useless without the function (in some
libary). If enough documentation is provided with the function/library, you
may be able to create the prototype yourself, otherwise the function/libray
is useless, complain to the vendor

Downloading one or the other from the net won't help, you need both and they
need to match

Bye, Jojo


 
Reply With Quote
 
Joachim Schmitz
Guest
Posts: n/a
 
      09-14-2007
"Richard Heathfield" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed)...
> yeah said:

What's up, your gmail filter broke?

Bye, Jojo


 
Reply With Quote
 
yeah
Guest
Posts: n/a
 
      09-14-2007
On Sep 14, 6:46 pm, "Joachim Schmitz" <(E-Mail Removed)>
wrote:
> "yeah" <(E-Mail Removed)> schrieb im Newsbeitragnews:1189776125.418077.140360@19g2000hs x.googlegroups.com...> The prototype for certain functions are missing in the header files.
> > Is it possible to download the particular functions from net and add
> > it to the program?

>
> A function is not the same as a prototype, a prototype merly describes (a
> part of) the interface of a funtion (i.e. it's in- and output types).
> A prototype (in some header) is useless without the function (in some
> libary). If enough documentation is provided with the function/library, you
> may be able to create the prototype yourself, otherwise the function/libray
> is useless, complain to the vendor
>
> Downloading one or the other from the net won't help, you need both and they
> need to match
>
> Bye, Jojo


ok.
and i am also getting error like for example

WARNING: "i2c_attach_client" [/work/uclinux/uClinux-dist/linux-2.6.x/
drivers/video/chumma/bfin_adv7393fb.ko] undefined!

but the <i2c.h> is included in the main program.The i2c.h contains

"extern int i2c_attach_client(struct i2c_client *);"

and also has written the function i2c_client.
but i dont understand why this error comes..

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      09-14-2007
Richard Heathfield wrote:
> yeah said:
>
>> I got this error "implicit declaration of function"
>> what it means???

>
> You forgot to provide a prototype for a function within the scope
> visible to the compiler at the point where it was compiling a call
> to that function.
>
> If it's a standard library function or a function from a third
> party library (or indeed from your own library), include the
> appropriate header.
>
> If it's one of your own functions, copy the declarator to near the
> top of the program, and bang a semicolon on the end of it. That
> should fix the problem.


Or, better, just move the whole function definition up ahead of the
first call to it. No duplications left to keep synced.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      09-14-2007
Joachim Schmitz said:

> "Richard Heathfield" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:(E-Mail Removed)...
>> yeah said:

> What's up, your gmail filter broke?


Kind of. I'd removed the "killfile on" filter so that I could analyse a
thread elseUsenet, and forgot to restore it. This happens occasionally.
(Also, *some* gmail users have been modded up. Not many, but I
think I've got most of the regular clueful gmailers for clc, anyway.)

Anyway, it's back on now.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
 
Reply With Quote
 
Joachim Schmitz
Guest
Posts: n/a
 
      09-14-2007
"yeah" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) ups.com...
> On Sep 14, 6:46 pm, "Joachim Schmitz" <(E-Mail Removed)>
> wrote:
>> "yeah" <(E-Mail Removed)> schrieb im
>> Newsbeitragnews:1189776125.418077.140360@19g2000hs x.googlegroups.com...>
>> The prototype for certain functions are missing in the header files.
>> > Is it possible to download the particular functions from net and add
>> > it to the program?

>>
>> A function is not the same as a prototype, a prototype merly describes (a
>> part of) the interface of a funtion (i.e. it's in- and output types).
>> A prototype (in some header) is useless without the function (in some
>> libary). If enough documentation is provided with the function/library,
>> you
>> may be able to create the prototype yourself, otherwise the
>> function/libray
>> is useless, complain to the vendor
>>
>> Downloading one or the other from the net won't help, you need both and
>> they
>> need to match
>>
>> Bye, Jojo

>
> ok.
> and i am also getting error like for example
>
> WARNING: "i2c_attach_client" [/work/uclinux/uClinux-dist/linux-2.6.x/
> drivers/video/chumma/bfin_adv7393fb.ko] undefined!
>
> but the <i2c.h> is included in the main program.The i2c.h contains
>
> "extern int i2c_attach_client(struct i2c_client *);"

Take a closer look at i2c.h, check whether that prototype is visible to your
translation unit (the .c that uses #include "i2c.h"), there could well be
some #if or #ifdef preventing that.

> and also has written the function i2c_client.
> but i dont understand why this error comes..

This may be beond the scope of comp.lang.c, maybe you look in some linux or
i2c (whatever that is) related newsgroups.

Bye, Jojo


 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      09-14-2007
yeah wrote:
>

.... snip ...
>
> and i am also getting error like for example
>
> WARNING: "i2c_attach_client" [/work/uclinux/uClinux-dist/
> linux-2.6.x/drivers/video/chumma/bfin_adv7393fb.ko] undefined!
>
> but the <i2c.h> is included in the main program.The i2c.h contains
>
> "extern int i2c_attach_client(struct i2c_client *);"
>
> and also has written the function i2c_client.
> but i dont understand why this error comes..


Where is the .c file that the i2c.h file allows your source to
connect to? Does that file contain a proper definition of the
i2c_client function? If so, are you linking its object file into
your final program? Maybe the i2c.h file defines things in a
library, if so have you told the compiler to link to that library?

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
implicit variable declaration and access Ali Razavi Python 16 06-16-2005 03:08 PM
Newbie: previous implicit declaration problem francescomoi@europe.com C Programming 2 02-23-2005 03:51 PM
What is an implicit extern "C" declaration? Andy C++ 2 01-28-2005 04:21 PM
implicit constructor declaration (user annoyed) sb C++ 10 02-25-2004 06:42 PM
implicit declaration of function 'int func(...)' error Jason C++ 3 01-01-2004 04:01 PM



Advertisments