extern in C

Brad Bonkoski bradb59@home.com
Tue, 06 Mar 2001 16:19:27 -0700


Hello,

I have a large project in which I have multiple .c files that I am
making a Linux Module out of.  I am trying to create an API for it, and
thought that an easy way would be to extern some of the functions that I
would allow "users" to include in their programs.  I thought I good
place to start is to make a demo package of the functionality, or make a
program myself using the *API*
So, the grunt of it:

I have three basic files that need to be used:
demo.c --> which calls the function add_to_cache( )
api.h --> which has the function prototype: extern int add_to_cache(
MAC_Value, IP_ADDR)
arp.c --> which has the function definition of add_to_cache( )

so, arp.c is part of the actual module, which builds and registers with
Linux.

Then I try to build demo.c seperately, linking only with the header file
(api.h) which is also included in arp.c
When compiling demo.c I get a linking error from 'ld' which says that
add_to_cache is an unresolved symbol.
What am I doing wrong?  when running "ksyms" the function appears to be
registered, so should it link, or is there somethine else I should do?

Any help would be appreciated.
Thanks,
Brad