implicit declaration of function???

R

Richard Heathfield

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.
 
Y

yeah

yeah said:


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?
 
J

Joachim Schmitz

yeah said:
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
 
Y

yeah

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..
 
C

CBFalconer

Richard said:
yeah said:


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.
 
R

Richard Heathfield

Joachim Schmitz said:
What's up, your gmail filter broke? :cool:

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. :)
 
J

Joachim Schmitz

yeah said:
Newsbeitrag
The prototype for certain functions are missing in the header files.

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
 
C

CBFalconer

yeah said:
.... 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?
 
B

Barry Schwarz

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..

Is the diagnostic message from the compiler or the linker? If it is
from the linker, then your problem is you didn't tell the linker in
which library it could find the function.


Remove del for email
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top