David Olofson wrote:

>  Stefan Schlosske wrote:
>
>> Hi,
>>
>> i want to use C++ in rt-modules. Is it possible? What are the
>> limitations? If it is not possible, why is it not possible?
>>
>> Regards,
>>
>> Stefan
>
> This has been discussed a few times already... Check out the archive
> on the RTL site. :-)
>
> Anyway, short version:
>
>        Possible: Yes
>
>     Limitations: Custom memory management
>                  needed for new/delete
>                  inside RT tasks
>
> If you can do with (instance_life_time == module_life_time), using
> kmalloc()/kfree() for new, new [], delete and delete [] will do.
>

  Not only so. I have an RTLinux application written in C++ and I am now
trying to port it to the 2.2.6 kernel (with Paolo Mantegazza's RTAI). I
find a lot of system include files, even some signed by Linus, which
have clearly not been designed to be included by c++ files. They contain
such things as reserved keywords ('class') used as parameters, or even
worse.
Moreover the egcs version of g++, which is replacing the original gnu
version (at least on RedHat from RedHat 5.1), forces to link a libgcc
which has been compiled with the -fPIC option. This causes the infamous
"unresolved _GLOBAL_OFFSET_TABLE_" message at insmod.
My solution is not elegant. I patch some system include files and I
countinue using the good old GNU g++.
It is too late now to rewrite my (large) application in C, but if I was
to start it, I think that I would choose C now.

Daniele

--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to