<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Here I post a simple rtems C++ code
(template.cc) which works if<br>
compiled as a C source file but not as a C++ file.<br>
I'm using sparc-rtems4.11-g++ compiler. Are there particular
compilation<br>
flags I have to use? Is C++ template different from C one? Thanks
a lot<br>
<br>
Luca<br>
-------------------------------------------------------------------------------------------------------------------------<br>
</div>
<small>#define CONFIGURE_INIT<br>
#include "system.h"<br>
#include <cstdlib><br>
<br>
<br>
extern "C" {<br>
rtems_task Init(<br>
rtems_task_argument arg<br>
);<br>
};<br>
<br>
/* Declare rtems tasks */<br>
rtems_task Init (rtems_task_argument argument); /*
Declare entry point */<br>
<br>
#include "define.h"<br>
#include "leon.h"<br>
#include "utils.h"<br>
#include "printSerial.h"<br>
<br>
rtems_task Init (rtems_task_argument argument)<br>
{<br>
printf("MY NAME IS LUCA!\n\r");<br>
rtems_task_delete(RTEMS_SELF);<br>
}</small><br>
-------------------------------------------------------------------------------------------------------------------------<br>
My Makefile flags:<br>
<br>
CXX = sparc-rtems4.11-g++<br>
BSP_PATH = /opt/$(INSTALL_POINT)/sparc-$(CCOMP)/leon2/lib<br>
SPECS_PATH = $(BSP_PATH)/bsp_specs <br>
<br>
LD_LIBS += -lgcc -lm -msoft-float -lrtems++ -lstdc++<br>
LD_PATH += -I../../include/leon -I../include -B$(BSP_PATH) -specs
$(SPECS_PATH)<br>
LDFLAGS += -mcpu=v8 -qrtems<br>
CXXFLAGS += -msoft-float -mcpu=v8 $(LD_PATH) -Wno-write-strings<br>
</body>
</html>