MPLAB C18 Compiler gives error in portable.h

I’m new to FreeRTOS. I have downloaded V4.7.2 and receive a "C:FreeRTOS 4.7.2Sourceincludeportable.h:235:Error: syntax error" when I attempt to compile the OS.  The syntax error points to "portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters );" in the portable.h file.  I have searched the entire 4.7.2 download and cannot find pxPortInitialiseStack declared anywhere.  (The target is a PIC18) What I am missing?

MPLAB C18 Compiler gives error in portable.h

It complains that portSTACK_TYPE is not known and this is often because MPLAB_PIC18F_PORT is no defined. When you opened the demo did you open a project or workspace. You need to open the workspace. Also when you open the workspace do you see three projects in the workspace? If not then you need to set MPLAB to allow multiple projects in one workspace. Set to allow multiple projects, then open the WORKSPACE [not project] in a clean unzip of freertos. pxPortInitialisestack is defined in port of MPLAB port.

MPLAB C18 Compiler gives error in portable.h

Here’s a little more detail: The unzipped FreeRTOS will compile properly (yes I have all three projects visible in the workspace). I’ve reduced my first new task (test.c) to a single line of #include "task.h" The build options for test.c show MPLAB_PIC18F_PORT in the "Macro Definitions" box.  When I compile the project with my single-line test.c added, I receive the compiler error in portable.h

MPLAB C18 Compiler gives error in portable.h

> Here’s a little more detail: > The unzipped FreeRTOS will compile properly (yes I have all > three projects visible > in the workspace). So the demo application as downloaded compiles without problems… > I’ve reduced my first new task (test.c) to a single line of > #include "task.h" > The build options for test.c show MPLAB_PIC18F_PORT in the > "Macro Definitions" > box.  When I compile the project with my single-line test.c > added, I receive > the compiler error in portable.h Ok – try #include "FreeRTOS.h" #include "task.h" I think that should fix the problem. FreeRTOS.h is required and brings in the port layer stuff in the correct order so you don’t get the warning about portBASE_TYPE. Regards.

MPLAB C18 Compiler gives error in portable.h

Thanks Richard, Adding the #include "FreeRTOS.h" cured the problem.