extern in C

Lucas Vogel lvogel@exponent.com
Tue, 6 Mar 2001 15:22:35 -0800


is the compiled object in your library path? I think the correct switch is
-I/path/to/compiled/obj(you'll have to double-check), but I think you have
to include it in some way.

HTH,
Lucas

> -----Original Message-----
> From: Brad Bonkoski [mailto:bradb59@home.com]
> Sent: Tuesday, March 06, 2001 4:19 PM
> To: none none
> Cc: bradb59@home.com
> Subject: extern in C
> 
> 
> 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
> 
> 
> _______________________________________________
> Plug-devel mailing list  -  Plug-devel@lists.PLUG.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-devel
>