Missing library? Issue when compiling a new FreeRTOS project

Hello all,

I am new in FreeRTOS and currently trying to implement my first project. I have followed the basic guidelines about the files tree setup, but when compiling I get an error that seems to be associated with the linker. Specifically, despite of including the “task.h” file, as well as it being part of the project, for some reason the xTaskCreate() function is not recognized. The question is, there is any specific library that need to be added to the linker path? I am using the latest version of CCS v12 (TI) and the target is the Tiva C’s TM4C123GH6PM processor.


Have you included the source code for FreeRTOS in your project?

Yes, all the files I am aware of are included.

I had this same problem before. It was resolved by including a CCS library in the search path for the linker. But I am not aware of a similar type of file for FreeRTOS, beyond the sources and headers in the package, which are included as seen above.

It’s probably not the problem, because when the #include “task.h” line is commented out, the implicit error message appears, which shows the compilation reads this file.

Hi @Reuven,
Could you share your FreeRTOSConfig.h?
This function is wrapped by configuration – configSUPPORT_DYNAMIC_ALLOCATION.

Please refer to task.h.


Here it is the complete file in three parts:

Checked that macro, it should be ok if set to ‘1’

Sorry that I missed this figure.
Could you help to check if all source files are compiled in your project?
From the figure, these source files in FreeRTOS/Source are under includes folder.
I’m not sure if they’re compiled in this IDE.


I guess the IDE / the generated project doesn’t compile the FreeRTOS sources like task.c because they are added as ‘Includes’ ? Is there a ‘Source’ node where you can add the source files ? It should be documented for this IDE howto setup a project correctly.
You can verify the Build output to see which files are compiled.
(BTW better post text as text. Code blocks quoted by enclosing it by 3 tildes ‘~’ or backticks ‘`‘.)

You can put some non-compilable code in tasks.c and see if you get the compilation error from that. This will verify if you are compiling tasks.c and other FreeRTOS source files. As others have suggested, you likely are not compiling them.

Yes, looking at the project view, task.c is allowed to be #included, but isn’t being compiled, as it is being listed under the “includes” category.

You need to add that directory to the SOURCE tree, not the include tree.

Wow interesting, I took care of the paths to each relevant folder and expected the compiler and the linker to freely access the necessary files. Did so to keep the original tree that FreeRTOS comes with so nothing is missed. There is any other way? Should I put all the relevant files in a single folder, maybe the same folder where the “main” function is?

I commented out all the included files in tasks.c and had no effect in the compilation (the same error as before), so is likely this file is being ignored.

Is my fault, I didn’t post this file. But so far checking the files are in the right location seem to be the right direction to go.

“Source” means the same location than the “main” function? I can try that.

I bet there is a way to organize the project tree in your IDE to have 1 ore more tree nodes containing Source files (getting compiled on build ). This should be documented somewhere.
But as a first step you can probably add all source files plain in the project tree root where your main.c is located.

I am not familiar with CCS, but most tools allow you to define a list of SOURCE file locations to compile.

Often, I will just start with one common directory and make an “application” sub-folder, and a “library” sub-folder, and put all the various libraries I am using as sub-folders to library. For FreeRTOS, to do this do NOT copy the full repositiory with all the demo and portable files, but only those that you will be using.

@Reuven just following up, has your issue been resolved?