Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Compiler errors in the queue.c file

Posted by keith soldavin on March 21, 2011
I am attempting to compile FreeRTOS 6.1.1 with IAR ARM compiler version 6.05 but I keep running into an error with a specific compiler option. I want to compile the code with the "Multi-file Compilation" option enabled but I always get errors in the queue.c file. An example of the errors I get is "declaration of function "xQueueTakeMutexRecursive" is incompatible with a declaration in another translation". I get roughly 15 errors in this file. If I remove the compiler option the code compiles perfectly and runs fine. Does anyone have any idea why these errors are coming up and how to avoid them?

Thank you

RE: Compiler errors in the queue.c file

Posted by Richard on March 21, 2011
I have never tried using that compiler options, so the following is just a guess:

The (deliberate) data hiding in the FreeRTOS kernel means that something like an xQueueHandle is a pointer to a structure inside the queue.c source file, but a pointer to a void * in all other files. It sounds like the compiler cannot cope with that when that particular option is used.


RE: Compiler errors in the queue.c file

Posted by Richard Damon on March 21, 2011
The problem is that the "Multi-file Compilation" option does not work with a mixed language project. The FreeRTOS kernel files must be compiled truly as C code, not C++ due to the way the data hiding is done (and a few other Cisms in the code, not surprising since it is C code).

You will either need to convert the code to be valid C++ code, which to start means changing the definition of handles from void * to being struct xxxx* (xxx depending on the given handle), which may kick up a few other errors, or you need to turn off the "Multi-file Compilation" option (this is what I did). You may also be able to change your project to compile FreeRTOS into a library module, and include that in your main project if you really need to use the Multi-file option.

RE: Compiler errors in the queue.c file

Posted by keith soldavin on March 21, 2011
Thank you for the input. The reason I wanted to try the multiple file option was to help the optimizer remove more unused code. I will try to compile the RTOS as a library without that option and then include it in my project.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner