Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

ARM under C & C++

Posted by Nobody/Anonymous on February 18, 2006
I'm trying to compile a program under FreeRTOS with IAR compiler and if I use C as language all compile without problems, but if I use embedded C++ or extended embedded C++ I obtain always the following errors:
Error[e46]: Undefined external "AT91F_LowLevelInit" referred in ?RESET ( C:\Empresa\
Inicio\Debug\Obj\Cstartup.r79 )
Error[e46]: Undefined external "vTaskSwitchContext" referred in portasm ( C:\Empresa\Inicio\
Debug\Obj\portasm.r79 )
Error[e46]: Undefined external "vTaskIncrementTick" referred in portasm ( C:\Empresa\
Inicio\Debug\Obj\portasm.r79 )

I tought that FreeRTOS supports C++ programming but I'm not sure.

If FreeRTOS supports C++ someone have an example of IAR compiler settings??

I'm developing with ARM7 AT91SAM7A3.

Thanks.

RE: ARM under C & C++

Posted by Nobody/Anonymous on February 18, 2006
I suspect it cannot find the functions because of C++ mangling the names. Try using extern "C" on the functions that are called from asm code.

RE: ARM under C & C++

Posted by Nobody/Anonymous on February 18, 2006
Thanks, but I think that you didn`t understand the question.
I don't use asm code. I have problems with C++ code.
For example, I have depeloped a class for encapsulate the task funcionality, I can compile the project with this class without problems, but when I write code for instance this class in my main function I have errors linking the project.
The errors are the following:
Linking
Error[e46]: Undefined external "xTaskCreate(pdTASK_CODE, signed char const *, unsigned
short, void *, unsigned long, void * *)" referred in ITask ( C:\Empresa\Inicio\Debug\Obj\
ITask.r79 )
Error[e46]: Undefined external "xTaskGetTickCount()" referred in ITask ( C:\Empresa\Inicio\
Debug\Obj\ITask.r79 )
Error[e46]: Undefined external "vTaskDelayUntil(portTickType *, portTickType)" referred in
ITask ( C:\Empresa\Inicio\Debug\Obj\ITask.r79 )
Error[e46]: Undefined external "vTaskDelete(void *)" referred in ITask ( C:\Empresa\Inicio\
Debug\Obj\ITask.r79 )
Error[e46]: Undefined external "vTaskStartScheduler()" referred in main ( C:\Empresa\Inicio\
Debug\Obj\main.r79 )

Someone have any idea???
Thanks


RE: ARM under C & C++

Posted by Nobody/Anonymous on February 19, 2006
While it may not be asm related it still sounds like the same problem. Are you compiling some files as c++ and some as c? If so they will not link. You need to compile it all as c++ (in which case I'm not sure it will work) or declare the c code as extern "c" (in which case it may work depending on what you are doing with the c++ code).

If you are not sure what this answer means then I suggest reading up a bit on mixing c and c++.

RE: ARM under C & C++

Posted by Jokke on February 20, 2006
Maybe the problem is that the compiler doesn't see the extern "C" when compiling the OS, but when it compiles the c++ code. Therefore the C++ expects unmangled names, but the OS functions are mangled. Look in your link listing if you can find mangled versions of the OS functions (in case you get a listing even with failed links).

Jokke

RE: ARM under C & C++

Posted by Jokke on February 20, 2006
I also experienced in one environment, that when I set it up for c++ all the *.c files were omitted, and not included in the make.

Jokke again


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists