sparc-rtems4.11-gcc for C++

Luca Cinquepalmi cinquepalmi at
Tue Oct 30 08:47:00 UTC 2012

Here I post a simple rtems C++ code ( which works if
compiled as a C source file but not as a C++ file.
I'm using sparc-rtems4.11-g++ compiler. Are there particular compilation
flags I have to use? Is C++ template different from C one? Thanks a lot

#include "system.h"
#include <cstdlib>

extern "C" {
   rtems_task Init(
     rtems_task_argument arg

/* Declare rtems tasks */
rtems_task Init (rtems_task_argument argument);                 /* 
Declare entry point */

#include "define.h"
#include "leon.h"
#include "utils.h"
#include "printSerial.h"

rtems_task Init (rtems_task_argument argument)
     printf("MY NAME IS LUCA!\n\r");
My Makefile flags:

CXX = sparc-rtems4.11-g++
BSP_PATH = /opt/$(INSTALL_POINT)/sparc-$(CCOMP)/leon2/lib
SPECS_PATH = $(BSP_PATH)/bsp_specs

LD_LIBS += -lgcc -lm -msoft-float -lrtems++ -lstdc++
LD_PATH += -I../../include/leon -I../include -B$(BSP_PATH) -specs 
LDFLAGS += -mcpu=v8 -qrtems
CXXFLAGS += -msoft-float -mcpu=v8 $(LD_PATH) -Wno-write-strings
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list