# problem freertos demo & new file

**URL:** <https://forums.freertos.org/t/problem-freertos-demo-new-file/986>\
**Category:** Kernel\
**Created:** [June 20, 2007, 4:31pm UTC](https://forums.freertos.org/t/problem-freertos-demo-new-file/986 "2007-06-20T16:31:43Z")\
**Posts on this page:** 5\
**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:** [June 20, 2007, 4:31pm UTC](https://forums.freertos.org/t/problem-freertos-demo-new-file/986/1 "2007-06-20T16:31:43Z")

</div>

**[pipson](https://sourceforge.net/u/pipson/)** wrote on [Wednesday, June 20, 2007](https://sourceforge.net/p/freertos/discussion/382005/thread/2e36a836/#8175):

What should i do to add new project? When I try to add new file to existing demo files, the error occurs: "Error[Pe020]: identifier "pdTASK\_CODE" is undefined D:\FreeRTOSV4.0.2\FreeRTOS\source\include\portable.h 157. On the [freertos.org](http://freertos.org) is written:&nbsp; "A preconfigured starting point for new applications - to ensure the correct development tool setup (compiler switches, debugger format, etc) it is recommended that new applications are created by modifying the existing demo projects." Can I change the name of the demo files?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 20, 2007, 4:39pm UTC](https://forums.freertos.org/t/problem-freertos-demo-new-file/986/2 "2007-06-20T16:39:17Z")

</div>

**[embeddedc](https://sourceforge.net/u/embeddedc/)** wrote on [Wednesday, June 20, 2007](https://sourceforge.net/p/freertos/discussion/382005/thread/2e36a836/#8175/0701):

Did you include FreeRTOS.h at the top of the new file?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 21, 2007, 10:19am UTC](https://forums.freertos.org/t/problem-freertos-demo-new-file/986/3 "2007-06-21T10:19:52Z")

</div>

**[pipson](https://sourceforge.net/u/pipson/)** wrote on [Thursday, June 21, 2007](https://sourceforge.net/p/freertos/discussion/382005/thread/2e36a836/#8175/c630):

Yes, I did

---

<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:** [June 21, 2007, 10:48am UTC](https://forums.freertos.org/t/problem-freertos-demo-new-file/986/4 "2007-06-21T10:48:54Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, June 21, 2007](https://sourceforge.net/p/freertos/discussion/382005/thread/2e36a836/#8175/e273):

There is not dependency on the file names.&nbsp; Provided FreeRTOS.h is included at the top of the file and BEFORE task.h, queue.h or semphr.h, then you should not get this error if modifying an existing project.&nbsp; I suspect there is some kind of header file dependency issue somewhere.&nbsp;

Try making the file almost empty, as:

—file start

#include "FreeRTOS.h"  
#include "task.h"

void vDummyFunction( void )  
{  
&nbsp;&nbsp;&nbsp; vTaskDelay( 10 );  
}

—file end

Does it compile then?

[note this file will not run unless vDummyFunction() is called from within an already created task, its just to test the compilation].

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 21, 2007, 11:59am UTC](https://forums.freertos.org/t/problem-freertos-demo-new-file/986/5 "2007-06-21T11:59:52Z")

</div>

**[pipson](https://sourceforge.net/u/pipson/)** wrote on [Thursday, June 21, 2007](https://sourceforge.net/p/freertos/discussion/382005/thread/2e36a836/#8175/bfd8):

Thanks! I had FreeRTOS.h included but not before task.h. I put it on the top of the file and it solved the problem.
