Portable C++ standard library
- AndrewAPrice
- Member
- Posts: 2303
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Portable C++ standard library
What implementations exists? Which would be the easiest to port to my OS?
My OS is Perception.
Here's just a few, but since I have been unable to port any of them to my os I can't tell you which one is the easiest.
http://www.sgi.com/tech/stl/
http://synesis.com.au/software/stlsoft/
http://ustl.sourceforge.net/
http://www.stlport.org/
http://www.sgi.com/tech/stl/
http://synesis.com.au/software/stlsoft/
http://ustl.sourceforge.net/
http://www.stlport.org/
Re: Portable C++ standard library
What C++ compiler are you using that does not come with a standard library?MessiahAndrw wrote:What implementations exists? Which would be the easiest to port to my OS?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Portable C++ standard library
A compiler for his own OS, perhaps?bregma wrote:What C++ compiler are you using that does not come with a standard library?MessiahAndrw wrote:What implementations exists? Which would be the easiest to port to my OS?
- AndrewAPrice
- Member
- Posts: 2303
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Portable C++ standard library
When I said:Combuster wrote:A compiler for his own OS, perhaps?bregma wrote:What C++ compiler are you using that does not come with a standard library?MessiahAndrw wrote:What implementations exists? Which would be the easiest to port to my OS?
I meant the my OS, since this is an osdev forum. I use GCC if you'd like to know.MessiahAndrw wrote:easiest to port to my OS?
Right now when I have time (I have too many college projects) I'm porting across the C standard library and writing wrappers for my own functions. I'll worry about C++ later.
My OS is Perception.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Portable C++ standard library
You could just port Newlib or another standard C library... Why reinvent the wheel?MessiahAndrw wrote:Right now when I have time (I have too many college projects) I'm porting across the C standard library and writing wrappers for my own functions. I'll worry about C++ later.
Re: Portable C++ standard library
You could just use Windows or another operating system... Why reinvent the wheel?pcmattman wrote:You could just port Newlib or another standard C library... Why reinvent the wheel?MessiahAndrw wrote:Right now when I have time (I have too many college projects) I'm porting across the C standard library and writing wrappers for my own functions. I'll worry about C++ later.
- AndrewAPrice
- Member
- Posts: 2303
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Portable C++ standard library
The way the most implementations of the standard C library handles some minor things like printing to the screen (printf()) is incompatible with the way my OS manages console output (a console output will eventually be a pointer to a type of window structure (the 3 window types planned for my window manager are: control-based (OS routines for optimized drawing of buttons/images/components), console-based, and direct-based (for 2d/3d/movie-drawing apps which require direct access to the window buffer and ignores the default window-manager drawing functions))).pcmattman wrote:You could just port Newlib or another standard C library... Why reinvent the wheel?
Are nested brackets valid English (I used them in coding (like this (and this)))?
My OS is Perception.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Portable C++ standard library
<offtopic>Candy wrote:You could just use Windows or another operating system... Why reinvent the wheel?
He's copying me!!! Stop it! Stop it!
(remembering childhood)
</offtopic>
Nested brackets are valid if you can still understand what is trying to be said, imho.
Re: Portable C++ standard library
I sounds more like your planned implementation of the C library is incompatible with the design of the C library. The standard C file streams abstract such details away.MessiahAndrw wrote: The way the most implementations of the standard C library handles some minor things like printing to the screen (printf()) is incompatible with the way my OS manages console output (a console output will eventually be a pointer to a type of window structure (the 3 window types planned for my window manager are: control-based (OS routines for optimized drawing of buttons/images/components), console-based, and direct-based (for 2d/3d/movie-drawing apps which require direct access to the window buffer and ignores the default window-manager drawing functions))).
If you're interested in porting the GCC compiler suite, including the C++ standard library, for you OS, all you need do is provide a stadard C library. The easiest way to do that is to port an existing library -- say, newlib. That means you provide a core set of about 8 POSIX-like system calls (eg. write(), abort()) from your OS, and the rest just works.
There's nothing to stop you from providing a complete custom binding library for your own OS. But if you want to use the standard stuff, you'll have to do things in a standard way.
--smw
- AndrewAPrice
- Member
- Posts: 2303
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Portable C++ standard library
That's like forcing my OS to be designed a certain way - to treat the console as a file stream. The reason I'm inspired to write my OS is because I have some abstract ideas of how to do things. I don't want to be told "this is how a console works" - I don't want to turn it into Yet-Another-POSIX-Clone.bregma wrote:There's nothing to stop you from providing a complete custom binding library for your own OS. But if you want to use the standard stuff, you'll have to do things in a standard way.
--smw
My OS is Perception.