FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2011 Threads] Compiler errors in the queue.c filePosted 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 Keith
RE: Compiler errors in the queue.c filePosted 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.
Regards.
RE: Compiler errors in the queue.c filePosted 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 filePosted 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.
Thanks Keith
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|