[En-Nut-Discussion] C++ support on Nut/OS ?

Bernd Walter enut at cicely.de
Tue Mar 23 12:48:09 CET 2010


On Tue, Mar 23, 2010 at 03:51:04AM -0700, Lost Jedi wrote:
> > On Tue, Mar 23, 2010 at 01:48:08AM
> > -0700, Lost Jedi wrote:
> > > My apologies if the earlier post was vague.
> > > 
> > > Let me be more specific :
> > > What is the process of adding a library to the Nut/OS
> > framework? For example, something like the libxml++ library
> > (http://libxmlplusplus.sourceforge.net)?
> > 
> > It should be possible if you have a beafy system with large
> > memory,

I take this statement back about libxml++.
It will be a lot of work to get it runnning - see below.

> > but on such systems you can also run any kind of UNIX.
> > C++ itself isn't a problem, but STL is already a very big
> > thing
> > and libxml++ uses it a lot.
> > 
> > If you just want to parse some XML you can also use
> > pro/uxml.h.
> > It has a very small footprint.
> > 
> 
> TBH our hardware will be designed around the software footprint, so mem requirements are flexible. I did have a look at uXML to see if it could be an option, however our app uses the DOM parser which uXML doesnt have.
> 
> The query though is *how to add* the library to Nut/OS?

Since there is no link loader support you need to add it as a static
library.
There is no general rule on how to do it since every lib has it's own
requirements.
libxml++ for example requires full Glib::ustring support to be available,
which itself requires knowledge about several encodings and STL
support - maybe just for data type conversion.
It's a can of worms if you don't have a POSIX system at the beginning.
You have to fix and strip everything down by hand, since those libraries
rarely support complex downsizing.
If you realy need to use such libs you are probably better served by
using another OS, e.g. FreeBSD, Linux, RTEMS, eCos, ...
I often use FreeBSD together with NutOS running neighbor systems for
the realtime tasks - depending on the application you might as well use
an FPGA for the realtime tasks instead of a CPU.

> Also going with the earlier query, the default nutcpp lib seems to have very limited c++ support. How do I add the gnu c++ lib to Nut/OS to include full C++ functionality?
> 
> Any help would be most appreciated! Thanks again!
> 
> 
>       

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



More information about the En-Nut-Discussion mailing list