# Build Failed with PIC32

**URL:** <https://forums.freertos.org/t/build-failed-with-pic32/1334>\
**Category:** Kernel\
**Created:** [October 27, 2008, 5:14am UTC](https://forums.freertos.org/t/build-failed-with-pic32/1334 "2008-10-27T05:14:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 27, 2008, 5:14am UTC](https://forums.freertos.org/t/build-failed-with-pic32/1334/1 "2008-10-27T05:14:28Z")

</div>

**[grantkbrown](https://sourceforge.net/u/grantkbrown/)** wrote on [Monday, October 27, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/381058b5/#162c):

Hi,

Could anyone explain why my project failed to build. The compiler error message is listed below.

Particularly things such as “undefined reference to `vPortStartFirstTask’”

Nothing regarding the compiler has changed.

I am using the PIC32 compiler from MPLab

This project is a copy of the PIC32 demo project that comes with FreeRTOS

I can upload the project if someone tells me where.

Many thanks  
Grant Brown

----------------------------------------------------------------------  
Debug build of project `C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\RTOSDemo.mcp’ started.  
Preprocessor symbol `\_\_DEBUG’ is defined.  
Target debug platform is `\_\_MPLAB\_DEBUGGER\_PIC32MXSK=1’.  
Mon Oct 27 16:04:44 2008  
----------------------------------------------------------------------  
Clean: Deleting intermediary and output files.  
Clean: Deleted file “C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\main.o”.  
Clean: Deleted file “C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\port.o”.  
Clean: Deleted file “C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\list.o”.  
Clean: Deleted file “C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\queue.o”.  
Clean: Deleted file “C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\tasks.o”.  
Clean: Deleted file “C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\heap\_2.o”.  
Clean: Deleted file “C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\init\_PIC32MX360F512L.o”.  
Clean: Done.  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L -x c -c “main.c” -o"main.o" -MMD -MF"main.d" -I"." -I"." -I"…\common\include" -I"…\…\source\portable\mplab\pic32mx" -I"…\…\source\include" -D\_\_DEBUG -g -DMPLAB\_PIC32MX\_PORT -Wall -fomit-frame-pointer  
main.c: In function `main’:  
main.c:90: warning: implicit declaration of function `VisualInitialization’  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L -x c -c “…\…\Source\portable\MPLAB\PIC32MX\port.c” -o"port.o" -MMD -MF"port.d" -I"." -I"." -I"…\common\include" -I"…\…\source\portable\mplab\pic32mx" -I"…\…\source\include" -D\_\_DEBUG -g -DMPLAB\_PIC32MX\_PORT -Wall -fomit-frame-pointer  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L -x c -c “…\…\Source\list.c” -o"list.o" -MMD -MF"list.d" -I"." -I"." -I"…\common\include" -I"…\…\source\portable\mplab\pic32mx" -I"…\…\source\include" -D\_\_DEBUG -g -DMPLAB\_PIC32MX\_PORT -Wall -fomit-frame-pointer  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L -x c -c “…\…\Source\queue.c” -o"queue.o" -MMD -MF"queue.d" -I"." -I"." -I"…\common\include" -I"…\…\source\portable\mplab\pic32mx" -I"…\…\source\include" -D\_\_DEBUG -g -DMPLAB\_PIC32MX\_PORT -Wall -fomit-frame-pointer  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L -x c -c “…\…\Source\tasks.c” -o"tasks.o" -MMD -MF"tasks.d" -I"." -I"." -I"…\common\include" -I"…\…\source\portable\mplab\pic32mx" -I"…\…\source\include" -D\_\_DEBUG -g -DMPLAB\_PIC32MX\_PORT -Wall -fomit-frame-pointer  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L -x c -c “…\…\Source\portable\MemMang\heap\_2.c” -o"heap\_2.o" -MMD -MF"heap\_2.d" -I"." -I"." -I"…\common\include" -I"…\…\source\portable\mplab\pic32mx" -I"…\…\source\include" -D\_\_DEBUG -g -DMPLAB\_PIC32MX\_PORT -Wall -fomit-frame-pointer  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L -x c -c “Generated Files\VDIInit\init\_PIC32MX360F512L.c” -o"init\_PIC32MX360F512L.o" -MMD -MF"init\_PIC32MX360F512L.d" -I"." -I"." -I"…\common\include" -I"…\…\source\portable\mplab\pic32mx" -I"…\…\source\include" -D\_\_DEBUG -g -DMPLAB\_PIC32MX\_PORT -Wall -fomit-frame-pointer  
Executing: “C:\Program Files\Microchip\MPLAB C32\bin\pic32-gcc.exe” -mprocessor=32MX360F512L “main.o” “port.o” “list.o” “queue.o” “tasks.o” “heap\_2.o” “init\_PIC32MX360F512L.o” -o"RTOSDemo.elf" -O3 -Wl,–defsym=\_\_MPLAB\_BUILD=1,–defsym=\_\_MPLAB\_DEBUG=1,–defsym=\_\_MPLAB\_DEBUGGER\_PIC32MXSK=1,–defsym=\_min\_heap\_size=0,–defsym=\_min\_heap\_size=0,-Map=“RTOSDemo.map”  
port.o: In function `xPortStartScheduler’:

…\…\Source\portable\MPLAB\PIC32MX/port.c:163: undefined reference to `vPortStartFirstTask’  
…\…\Source\portable\MPLAB\PIC32MX/port.c:163: relocation truncated to fit: R\_MIPS\_26 against `vPortStartFirstTask’  
port.o: In function `\_\_vector\_dispatch\_1’:  
…\…\Source\portable\MPLAB\PIC32MX\port.c:(.vector\_1+0x0): undefined reference to `vPortYieldISR’  
…\…\Source\portable\MPLAB\PIC32MX\port.c:(.vector\_1+0x0): relocation truncated to fit: R\_MIPS\_26 against `vPortYieldISR’  
port.o: In function `\_\_vector\_dispatch\_4’:  
…\…\Source\portable\MPLAB\PIC32MX\port.c:(.vector\_4+0x0): undefined reference to `vT1InterruptHandler’  
…\…\Source\portable\MPLAB\PIC32MX\port.c:(.vector\_4+0x0): relocation truncated to fit: R\_MIPS\_26 against `vT1InterruptHandler’  
Link step failed.  
----------------------------------------------------------------------  
Debug build of project `C:\Program Files\Microchip\FreeRTOS\Demo\PIC32MX\_MPLAB\RTOSDemo.mcp’ failed.  
Preprocessor symbol `\_\_DEBUG’ is defined.  
Target debug platform is `\_\_MPLAB\_DEBUGGER\_PIC32MXSK=1’.  
Mon Oct 27 16:04:50 2008  
----------------------------------------------------------------------  
BUILD FAILED

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 27, 2008, 7:14am UTC](https://forums.freertos.org/t/build-failed-with-pic32/1334/2 "2008-10-27T07:14:45Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, October 27, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/381058b5/#162c/bb5c):

The functions it cannot find are all defined in FreeRTOS\Source\portable\MPLAB\PIC32MX\port\_asm.S - so I would guess this file is not included in your project.

Regards.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 27, 2008, 7:16am UTC](https://forums.freertos.org/t/build-failed-with-pic32/1334/3 "2008-10-27T07:16:27Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, October 27, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/381058b5/#162c/bb5c/e68a):

I have just noticed that there is a new version of MPLAB available.&nbsp; Maybe this is why there have been a couple of PIC32 build problems in the last couple of days.&nbsp; I’m just downloading it now to see what effects it has on my build.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 27, 2008, 8:15am UTC](https://forums.freertos.org/t/build-failed-with-pic32/1334/4 "2008-10-27T08:15:56Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, October 27, 2008](https://sourceforge.net/p/freertos/discussion/382005/thread/381058b5/#162c/bb5c/e68a/1760):

I just tried with MPLAB V8.15 and a clean install of [FreeRTOS.org](http://FreeRTOS.org) V5.1.0 - all built with no problems.

MPLAB now contains a FreeRTOS viewer.

Regards.
