CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Finding "Function used but not defined" issues

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

Finding "Function used but not defined" issues
PostPosted: Mon Oct 12, 2009 11:26 am     Reply with quote

Hey guys,

As you know, I've been working on the latest stack from Microchip and there are some issues I hardly ever see writing my own code but have found while converting this unwieldy code from MCHP. (not that I can't blame anyone. TCP/IP is not exactly printf("Hello World") )

So I'm curious as to what you guys have found when dealing with an error like this: (example)

udp.h has a proto for UDPInit() that looks like this: void UDPInit(void);
- Simply enough.

UDP.h is shown having been included in the MPLAB IDE project every time I compile.

in UDP.c, this code is the implementation

Code:
/*****************************************************************************
  Function:
   void UDPInit(void)

  Summary:
   Initializes the UDP module.

  Description:
   Initializes the UDP module.  This function initializes all the UDP
   sockets to the closed state.

  Precondition:
   None

  Parameters:
   None

  Returns:
     None
     
  Remarks:
   This function is called only one during lifetime of the application.
  ***************************************************************************/
void UDPInit(void)
{
    UDP_SOCKET s;

    for ( s = 0; s < MAX_UDP_SOCKETS; s++ )
    {
      UDPClose(s);
    }
   Flags.bWasDiscarded = 1;
}



When I compile, I get this error *** Error 112 "C:\Documents and Settings\bkamen\Desktop\Ethertest-firmware\TCPIP Stack\stacktsk.c" Line 144(1,1): Function used but not defined: ... UDPInit SCR=28053


In the past, I found that if the proto and the implementation use different types in the function declaration, that causes PCD unhappiness. (like saying func(int1 a) and then implementing as func(int8 a)) which is fine and makes sense.


So what I'm asking you guys is what you look for when you have a boatload of files being compiled and the one causing the "crash" doesn't seem to have any rhyme or reason as to why. (at least that I'm used to seeing)

Thanks,

BTW, this is PCH 4.099 w/MPLAB 8.36 doing the compiling at the moment.

-Ben

p.s. I did look at some threads here like these:
http://www.ccsinfo.com/forum/viewtopic.php?t=38254
http://www.ccsinfo.com/forum/viewtopic.php?t=18649 (boy I wish it was that easy)
http://www.ccsinfo.com/forum/viewtopic.php?t=35772 (ditto)
http://www.ccsinfo.com/forum/viewtopic.php?t=34689 (ditto)

But they don't really cover the scale of something like MCHP's TCP/IP stack.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Oct 12, 2009 11:45 am     Reply with quote

Ok, I think I found the problem with UDPInit not being defined.

There's no file that includes the item.C versions(!). (shaking head)

I would still like to hear the senior programmer comments though.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group