« Return to Thread: MPLAB Pre-processor

MPLAB Pre-processor

by Justin Richards :: Rate this Message:

Reply to Author | View in Thread

I have been trying to merge free snippets of code and having problems with
the MPLAB pre-processor.

Is there a way to debug the pre-processor directives.

I get the following error,

C:\data\MPLAB\Ethernet\MyPicWeb\src\net\include\StackTsk.h:65:Error [1099]
Invalid MAX_TCP_SOCKETS value specified.

but MAX_TCP_SOCKETS is clearly defined as

#define MAX_TCP_SOCKETS     (8ul)

in an include file that is included before StackTsk.h is included. (in
tick.c)

I tried

#define MAX_TCP_SOCKETS     (9ul)

  just before

#if (MAX_TCP_SOCKETS <= 0 || MAX_TCP_SOCKETS > 255)
#error Invalid MAX_TCP_SOCKETS value specified.
#endif

and get

C:\data\MPLAB\Ethernet\MyPicWeb\src\net\include\StackTsk.h:61:Error [1034]
previous definition of macro 'MAX_TCP_SOCKETS' does not agree

so I tried

#define MAX_TCP_SOCKETS     (8ul)

just before the #if ... #endif

and no problems.

So the pre-processor is aware the label is pre-defined but complains.

I am obviously missing the point, any suggestion exactly what the compiler
is complaining about.

I have tried going thru the help with search words like preprocessor and
#define but they dont really give me an insight into the way include files
and the corresponding pre-processor directives are processed.

Any links pointers etc welcome,

Cheers Justin
--
http://www.piclist.com PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

 « Return to Thread: MPLAB Pre-processor