It can't be static in the header or in the .c file if you intend to use it in other 
translation units (.c files).  Make it extern in the header and c file or don't supply 
a linkage and it will be extern by default.

Kevin

-----Original Message-----
From: jessie smith [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 11:29 AM
To: Palm Developer Forum
Subject: function call


This maybe very simple but for some reason I don't see
the problem. I have two .c files (f1.c and f2.c) and
one header file (fh.h).

In fh.h:
static void UnpackRecord(RecType *rec, PackType
*pack);

In f1.c 
#include "fh.h" 

/* function */
static void UnpackRecord(RecType *rec, PackType
*pack){
  ...
  ...
}

I can call this function, no problem:
UnpackRecord(&rec, packrec);

However, if I make the same call from f2.c, I will get
a link error: 
f2.c: 'UnpackRecord' referenced from .... is
undefined.

I have the same include statement #include "fh.h" in
f2.c. Where is the problem?

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


------------------------------------------

The information in this transmittal and any attachments is privileged and confidential 
and is intended only for the recipient(s) listed above. You are hereby notified that 
any unauthorized distribution or copying of this transmittal or its attachments is 
prohibited. If you have received this transmittal in error, please notify Invivodata 
immediately at (831) 438-9550.

------------------------------------------


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to