Dingoonity.org

Dingoo Official Firmware => Development => Topic started by: flatmush on March 10, 2010, 11:14:26 am

Title: Platform Independant Dingoo SDK
Post by: flatmush on March 10, 2010, 11:14:26 am
I've combined approaches from multiple sources to create a platform independent Native Dingoo SDK.
It contains the source for all the tools used to create it and contains sample applications, libc source code and makefiles to show users how to simply and cleanly make applications for the Dingoo A320.

It also contains clear instructions on how to install and setup Cygwin and scripts/programs to perform most of the installation hassle free.

It contains a program to fix the no CD inserted into drive error with Cygwin to allow the toolchain to work on laptops/computers that don't have a Drive labeled D in windows.

Included samples which can be compiled with a single make command on either windows or Linux include:

Any thoughts or improvements are appreciated as I want to make this everyone's SDK.

The SDK can be downloaded from here. (http://code.google.com/p/dingoo-sdk/downloads)

The Google Code Project page can be found here, looking for contributors. (http://code.google.com/p/dingoo-sdk/)

Edit: Damn I spelled independent wrong :(
Title: Re: Platform Independant Dingoo SDK
Post by: SiENcE on March 10, 2010, 03:42:08 pm
Great work.

Does this Dingoo Nativ SDK includes all nativ sdk enhancements from all different sdk's out there? I mean, does tvout is working, does SIM building work...aso.?
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 10, 2010, 03:43:28 pm
No, it contains some enhancements but you'd have to look, I messaged most of the developers of other sdks and invited them to join the googlecode project, you're welcome to join aswell if you want (and have a googlemail account).
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on March 11, 2010, 12:46:42 am
It installed ok, but I can't compile AstroLander with it.
I've tried both a standard command prompt and through cygwin (I would really prefer to be able to use a standard command prompt like used to do).

Error when running it through cygwin:
mipsel-linux-ld: cannot find c:/dingoo_sdk/lib/dingoo.o

That's not the right location.
My path in cygwin.bat is specified to /dingoo_sdk which should mean c:\cygwin\dingoo_sdk.....


And btw, the link in your post to the download is broken (dingoo_sdk.zip should be dingoo_sdk_100.zip).
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 11, 2010, 11:38:42 am
Good find, I need to change the installer script to modify dingoo.xn, if you want it to work right now then you just need to modify
$DINGOO_SDK/lib/dingoo.xn
Change the path from c:\dingoo_sdk\lib\dingoo.o to your actual path, I'll try to fix the installer script now.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 11, 2010, 12:08:42 pm
I fixed the linker script problem and I've released revision 6 which contains some minor changes and the MineSweeper sample.
You can download it from the updated link at the top.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on March 11, 2010, 05:37:59 pm
Alright, seems to work now.

Regarding files in Astrolander/lib and MineSweeper/lib etc. Aren't these global enough to be put somewhere more central? Instead of copy/paste them for every project/sample.

I've done a few changes to them for my projects.. although on the other hand, at least one of the changes changed the behaviour a bit, and I shouldn't add those changes.

What do you think about this?
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 11, 2010, 09:36:06 pm
You are right, I thought about this and we should make it a lib, but there are two things:
1. I wanted there to be an example of how to compile sources with multiple folders, since that's important for people to know for larger projects.
2. I'm not sure what the lib should be called or contain.

If you wanna take on the responsibility of putting that lib together then that'd help a lot, and I can just give you my latest modifications to it. At the minute I'm wondering whether to depreciate the graphics section of the lib since FGL does the job, but FGL doesn't have fast functions for sprites, rectangles or lines yet and may not be as fast for certain things (faster for triangles though).
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on March 12, 2010, 12:33:51 am
I'm not sure if I have time to take responsibility for that now. But let's start by discussing things anyway.

I think all of control, display, fixmath, graphics, and timer should be in it. I also would like to add audio. I might also want to add the mixer I wrote.

About graphics. I would personally like to see a version of the font functions and the tex_draw which takes magenta as a transparent color. That's quite common. But I assume the reason you made the font drawing functions that way was because of speed.
And also, I think one reason to keep this graphics.c is that the source to it is open.

Maybe the files could be put directly in lib, or in any folder there.

Edit:
btw, I commited fsys_find* and a sample to use them.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 12, 2010, 08:34:50 am
You're right about the graphics thing, thing is I'm tempted to just open source FGL but I don't want it being stolen and used without credit due to the effort I put in.

I already made colorkey transparent sprites (not just magenta trasparent, whatever color you choose) with RLE, which I can add, and I think I could improve some of the functions. I was thinking of making dynarec fonts to make them much faster which would add that functionality but I'd need to find time for it.

Thanks for commiting the fsys_ commits btw they look very useful.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on March 14, 2010, 09:41:20 pm
What do you think of adding these things to the lib directory? Or any subfolder in it?
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 14, 2010, 11:35:40 pm
What do you think of adding these things to the lib directory? Or any subfolder in it?

Done, I called the library SML (Simple Media Library) for the minute till anyone can think of a better name. I modified a few things and made all the samples work (and made the installer script make it). I also added rle encoded colorkey transparent sprites to the library and made an accompanying sample to show them working.

I welcome any upgrades you may have made to the library.

Also I made macros for control_just_pressed, control_just_released, control_still_pressed and control_still_released.
control_just_pressed is a direct replacement for the function you added called control_pressed_once.

Also I updated the link above which now links to version 1.1.1, the version numbering is basically the SVN revision + 1.0.0 till I can think of a better way.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on March 16, 2010, 01:36:47 am
I've commited updates to the tga loading. I'll commit more of my changes another day.


Why is this line:
if((inTexture->width & 0xF) != 0)
needed in gfx_render_target_set?

I removed it in my local version, since I wanted to create 24x24 images and draw on them.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 16, 2010, 10:26:33 am
Why is this line:
if((inTexture->width & 0xF) != 0)
needed in gfx_render_target_set?

I removed it in my local version, since I wanted to create 24x24 images and draw on them.

The reason is that the display_flip function assumes that the display width is a multiple of 16, so a render target that's 24x24 couldn't be rendered to the screen, it'd just be a bit more work to add code to allow all sizes to be rendered to the screen, alternatively there could be a flag that says a render target can't/won't be flipped with the display buffer.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on March 16, 2010, 01:45:37 pm
I see.
I think a flag would enough.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 16, 2010, 02:44:59 pm
Version 114 is released, everybody using the SDK should update to this version since it uses patched code to allow it to run on HK dingoos too, it also decreases the loading time of APPs on normal dingoos.

The download link at the top now points to the updated download.
Title: Re: Platform Independant Dingoo SDK
Post by: kswildside on March 18, 2010, 02:07:14 pm
Hey Flat & Hart you guys are my hero's for implementing this patch into the SDK this will make programming on the native completely compatible currently with all Dingoo A320's this totally rocks and thank both of you for your hard and tireless work to make the native development a reality...
Title: Re: Platform Independant Dingoo SDK
Post by: retro486 on March 26, 2010, 07:23:10 pm
First off: I'm using the v1.2.5 copy of your SDK from Google Code (http://code.google.com/p/dingoo-sdk/downloads/list) (the latest on your website (http://flatmush.juliusparishy.com/a320/toolchain/) is only 119).

Thanks for the awesome toolkit patch and game lib! I'm Debian 5 (Lenny) and I'm having a few issues with libsml and the examples:

In src/sml/wav.c there are several instances where sound_t->sample_data is incorrectly referenced as sound_t->data.

The sml_sound_example also had one of these typos and also had sound_t incorrectly named wav_buffer (if I remember correctly). I can't get this one to link due to the linker complaining about libgcc.a not being a non-PIC file. I'm not sure how to handle this one as I didn't see the code for it included in the src folder. Can you provide a link to the source so I can rebuild it and try again?

Thanks for the great work thus far!

EDIT: Here's the actual error I'm getting, in case I didn't interpret it correctly. I get this error for pretty much all the examples, except for MineSweeper:
Code: [Select]
mipsel-linux-ld: /opt/dingoo_sdk//lib/libgcc.a(_divdi3.o): warning: linking PIC files with non-PIC files
make: *** [sml_audio_demo.elf] Segmentation fault
make: *** Deleting file `sml_audio_demo.elf'
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on March 30, 2010, 09:28:27 pm
I fixed the wav thing that was a stupid error on my part, check the issue on googlecode for my thoughts on it, but I think you may have the wrong version of libgcc.a.
Title: Re: Platform Independant Dingoo SDK
Post by: Shin-NiL on April 07, 2010, 02:46:54 pm
Hello guys!

Is there any mirror to Ingenic toolchain for linux? Seems that the Ingenic's ftp is not working.

Thanks.
Title: Re: Platform Independant Dingoo SDK
Post by: kswildside on April 07, 2010, 03:22:37 pm
Nanonote has a mirror of the Ingenic FTP not sure if it is up to date
Title: Re: Platform Independant Dingoo SDK
Post by: Shin-NiL on April 08, 2010, 01:26:36 am
Nanonote has a mirror of the Ingenic FTP not sure if it is up to date

Sorry, I can't find it  :'(
Is it hosted at http://sharism.cc? Can you send me the link, if possible?

Thank you very much.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on April 08, 2010, 01:50:32 am
I've mirrored the ucos/mipsel toolchain for linux here (http://flatmush.juliusparishy.com/a320/toolchain/mipsel-4.1.2-nopic.tar.bz2), should work with the SDK.
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on April 08, 2010, 07:11:46 am
Version 114 is released, everybody using the SDK should update to this version since it uses patched code to allow it to run on HK dingoos too,
Hi flatmush,
What does it mean exactly ? we do not have to do anything to have an app or a sim file compatible for each dingoo model ?
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on April 08, 2010, 01:11:22 pm
Yup should do, good to see you back posting, you thinking of developing for the dingoo again?
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on April 08, 2010, 02:04:39 pm
you thinking of developing for the dingoo again?
my first goal is to test your new sdk, and yes, i'm coming back. Lot's of my DS stuffs are now ok, i can share time between DS and Dingoo ;)
Title: Re: Platform Independant Dingoo SDK
Post by: Shin-NiL on April 08, 2010, 02:09:59 pm
I've mirrored the ucos/mipsel toolchain for linux here (http://flatmush.juliusparishy.com/a320/toolchain/mipsel-4.1.2-nopic.tar.bz2), should work with the SDK.

Thank you very much flatmush, I can finally try to do some native stuff  :D
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on April 08, 2010, 03:04:48 pm
Great to have you back alekmaul.
I hope you also want to work on the SDK :)
Title: Re: Platform Independant Dingoo SDK
Post by: SiENcE on April 08, 2010, 03:23:55 pm
you thinking of developing for the dingoo again?
my first goal is to test your new sdk, and yes, i'm coming back. Lot's of my DS stuffs are now ok, i can share time between DS and Dingoo ;)

Welcome back Alek :).

@Shin-NiL: You can also compile with this windows-toolchain stuff for Dingux. I have an early port of SDL compiled for this. But this is only tested when compiling for Dingux. I don't know if this SDL lib also works with flatmush-SDK. If someone is interested in, tell me, i will share it.
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on April 08, 2010, 06:57:10 pm
thanks all for comments, nice to see again some nice people on native os scene ^^
flatmush, when i tried to install sdk, a little pb occured :
 - dingoo_sdk/src/fgl is not here and the ./install script displays an error about that

Except this point, i tested the 3d cube demo sample and it works fine, nice work flatmush :D !
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on April 08, 2010, 07:03:20 pm
Doesn't matter, it just compiles a copy of the source if you have it but I didn't release it yet, all the headers and the lib are there though so you can still compile fgl stuff.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on April 09, 2010, 08:52:08 pm
I just changed the font functions a bit, you can now specify the transparent color.
Anyone using the font functions will have to replace gfx_texture to gfx_font and use the gfx_font_load function instead to load it.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on April 12, 2010, 04:22:49 pm
OK, everyone who hasn't updated yet should update to r94, it's a big change as you can see on the google-code (I'm not repeating stuff here). The links at the top are updated.
Title: Re: Platform Independant Dingoo SDK
Post by: Shin-NiL on April 12, 2010, 05:06:25 pm

@Shin-NiL: You can also compile with this windows-toolchain stuff for Dingux. I have an early port of SDL compiled for this. But this is only tested when compiling for Dingux. I don't know if this SDL lib also works with flatmush-SDK. If someone is interested in, tell me, i will share it.

Thank you SiENcE, I did not know that  ;)

Did you mean a SDL for native development? It would be so great, I'm interested!
Title: Re: Platform Independant Dingoo SDK
Post by: SiENcE on April 12, 2010, 11:07:54 pm
Mh. Currently this is only tested on Dingux. I don't know how much Flatmush's SDK uses from this Toolchain. Header files, libs ...? If not it SDL must be compiled against the SDK and not the Toolchain.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on April 12, 2010, 11:48:19 pm
The SDK only uses the compiler tools and libgcc from the toolchain, not any of the headers or other libs.
Title: Re: Platform Independant Dingoo SDK
Post by: SiENcE on April 13, 2010, 09:10:16 am
Ok. So it has to be tested.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on April 18, 2010, 12:55:55 am
Critical bugfix, all users should update.
Title: Re: Platform Independant Dingoo SDK
Post by: yefeng on April 23, 2010, 05:14:20 am
Well,the color of font is white,I think it'll be nice that adding a argument "gfx_color inColor" to function "gfx_font_print" , ;)
Code: [Select]
void gfx_font_print(int16_t inX, int16_t inY, gfx_font* inFont, char* inString, gfx_color inColor) {
if((inFont == NULL) || (inString == NULL) || (inFont->texture == NULL))
return;

uint16_t* tempBuffer = gfx_render_target->address;
uint16_t* tempFont = inFont->texture->address;
uint8_t*  tempChar;
int16_t   tempX = inX;
int16_t   tempY = inY;
uintptr_t i, j, x, y;

for(tempChar = (uint8_t*)inString; *tempChar != '\0'; tempChar++) {
if(*tempChar == ' ') {
tempX += (inFont->texture->width >> 4);
continue;
}
if(*tempChar == '\t') {
tempX += ((inFont->texture->width >> 4) << 2);
continue;
}
if(*tempChar == '\r') {
tempX = inX;
continue;
}
if(*tempChar == '\n') {
tempX = inX;
tempY += (inFont->texture->height >> 4);
continue;
}
for(j = ((*tempChar >> 4) * (inFont->texture->height >> 4)), y = tempY; (j < (((*tempChar >> 4) + 1) * (inFont->texture->height >> 4))) && (y < gfx_render_target->height); j++, y++) {
for(i = ((*tempChar & 0x0F) * (inFont->texture->width >> 4)), x = tempX; (i < (((*tempChar & 0x0F) + 1) * (inFont->texture->width >> 4))) && (x < gfx_render_target->width); i++, x++) {
if (tempFont[(j * inFont->texture->width) + i] != inFont->colorKey) {
tempBuffer[(y * gfx_render_target->width) + x] = ~(tempFont[(j * inFont->texture->width) + i]) | inColor;
}
}
}
tempX += (inFont->texture->width >> 4);
}
}

Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on April 23, 2010, 07:41:49 am
The fonts thing is currently made to support mult-colored bitmap fonts using color key for the background, if you want to change the source to have the possibility to do colorized fonts too then you can post the code and I'll add it to the SDK. I'll also add an issue ticket on this incase anybody else wants to fix it.
Title: Re: Platform Independant Dingoo SDK
Post by: yefeng on April 23, 2010, 10:36:22 am

Here is the screenshot!
(http://www.file-pasta.com/file/0/screenshot0.PNG)

Compiled app file with source code download:
http://www.file-pasta.com/file/0/ColorFont.zip (http://www.file-pasta.com/file/0/ColorFont.zip)

Two sml LIB source file have a small changed:
1.graphics.h
http://www.file-pasta.com/file/0/graphics.h
2.graphics.c
http://www.file-pasta.com/file/0/graphics.c

Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on April 23, 2010, 09:36:55 pm
To explain the problem, some fonts already contain colors in the actual tga's. Those fonts won't really work that well with this code.

So I guess our options are:

1. Make a new set of functions which accepts colors, for example gfx_font_print_color()
or
2. Add a function gfx_font_set_color() / gfx_font_clear_color() which controls the color with the normal font functions
Title: Re: Platform Independant Dingoo SDK
Post by: comatsu on May 18, 2010, 01:24:51 pm
So I've installed Cygwin and the SDK following the instructions in the txt.
However when I try to built the samples included with the SDK I get an error: "cannot find -lsml"

If I try to build the program in the 'test' folder I get another error: "unrecognized option '-Wextra'"

Could anyone tell me what im doing wrong please?
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on May 18, 2010, 01:52:50 pm
If it can't find sml it sounds like the installation didn't work out properly.. maybe you could post your install log.
./install &> log.txt
Title: Re: Platform Independant Dingoo SDK
Post by: comatsu on May 18, 2010, 01:57:57 pm
Install log (bit long).  If i should post the txt file instead let me know and i'll remove this.
[log removed]

Problem solved. Thanks Harteex.
For anyone having the same problem make sure you are don't have an older version of the mipsel compilers installed.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on May 18, 2010, 11:30:14 pm
Just a note, a new version was posted today in the downloads section at google code. It's recommended to update to this version.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on May 21, 2010, 11:37:59 pm
Yefeng's color fonts have been implemented but in a slightly different way, see http://code.google.com/p/dingoo-sdk/source/detail?r=192 for details...
Title: Re: Platform Independant Dingoo SDK
Post by: nzeemin on June 14, 2010, 06:25:27 pm
I think it will be great to add some mini unit test framework for the libraries included in the SDK.
It can be simple application plus a set of include files, every file is one test suite.
If you put new test suite file, it will be automatically included with the next build.
You can run the application on a real Dingoo and have a list of successed/failed cases.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on June 14, 2010, 07:37:20 pm
I think it will be great to add some mini unit test framework for the libraries included in the SDK.
It can be simple application plus a set of include files, every file is one test suite.
If you put new test suite file, it will be automatically included with the next build.
You can run the application on a real Dingoo and have a list of successed/failed cases.

If I understand you correctly then there is already one. Have a look at the test directory.
Well, except that test cases aren't their own files (yet?).
It only covers a few things so far though.
Title: Re: Platform Independant Dingoo SDK
Post by: Tim0xA on June 22, 2010, 09:23:10 pm
If I keep the button X for some seconds, the application (compiled with Native Dingoo SDK) automatically closed. Why it occurs?
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on June 23, 2010, 07:38:45 am
If I keep the button X for some seconds, the application (compiled with Native Dingoo SDK) automatically closed. Why it occurs?

Because of this thing in the main loop (or where is your main game loop) :
Quote
     sysref = _sys_judge_event(NULL);
    if (sysref < 0) {
       break; 
    }
Title: Re: Platform Independant Dingoo SDK
Post by: Tim0xA on June 23, 2010, 08:39:45 am
Because of this thing in the main loop (or where is your main game loop) :
Quote
    sysref = _sys_judge_event(NULL);
    if (sysref < 0) {
       break;  
    }
But "Minesweeper", "Astrolander" and others samples from SDK has this problem too. Why?
(Firmware 1.2, ILI9325)
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on June 23, 2010, 11:29:02 am
Because they HAVE such code  ;D !!!
Title: Re: Platform Independant Dingoo SDK
Post by: Tim0xA on June 23, 2010, 12:15:05 pm
Because they HAVE such code  ;D !!!
I understood.
Key "X" (and combination Start+L and others OS keycodes) work if application have such code.
Thanx!
Title: Re: Platform Independant Dingoo SDK
Post by: nzeemin on July 14, 2010, 11:16:20 am
Hello, Dingoo SDK developers!

I trying to port one open-source game project for Dingoo native with the Dingoo SDK.
But there is two non-implemented functions used in the code:
Can you implement the functions in the next build?

P.S. Of course, it's not urgent. I use stubs for now.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on July 14, 2010, 11:22:14 am
If I get time I may do but add an ISSUE on the googlecode site to ensure we remember, basically the Dingoo RTC can't be used in native so even if we implemented the tm structure then it would return all zeros, so you may aswell just remove the code that uses it.
For fflush the only functions which buffer are the ones that write to actual files, in this case you can use the native function fsys_flush() to do the same thing, however we're not certain of the prototype for that function (i.e. whether it takes any arguments). You could guarantee a flush by closing the file and reopening it then seeking to the correct point again.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on August 20, 2010, 02:13:10 am
New version posted at the google code page: http://code.google.com/p/dingoo-sdk/downloads/detail?name=dingoo_sdk_r251.zip
The Google Code server seems a bit instable right now, so if you're having problems with the download, try this mirror (http://www.mediafire.com/?wml1gffscf8v690).

This is a quite huge release :)

Here's a rough list of additions and fixes:
* SDL is now added and working
* Basic C++ support
* libm ported
* More libc functions supported
* Crashes in exit() fixed
* Various other additions and fixes

Also, thanks and welcome to djdron who is the person behind the C++ support and libm port among other things.
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on August 22, 2010, 07:25:14 am
Hi all,
Just a question about c++ support.
I tried to compile a cpp emu (a2600) and i have a lot of error like that
Quote
mipsel-linux-g++ -G0 -O3 -I/cygdrive/c/cygwin/dingoo_sdk/include -I../lib -I/cyg
drive/c/cygwin/mipsel-gcc4.1-nopic/mipsel-linux/include -I -mips32 -mno-abicalls
 -fno-pic -Wall -Wextra -finline-functions -fomit-frame-pointer -msoft-float -fn
o-builtin -fno-exceptions -D_DEBUG -DMPU_JZ4740 -c -o src/emu/Booster.o src/emu/
Booster.cpp
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../.
./../include/c++/4.1.2/cstring:87: error: '::strcmp' has not been declared
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../.
./../include/c++/4.1.2/cstring:88: error: '::strcoll' has not been declared

Is it because C++ support is only at the beginning ?
Title: Re: Platform Independant Dingoo SDK
Post by: joyrider on August 22, 2010, 09:54:39 am
alekmaul, i had the same problem(s) as you described this is how i solved it :

- in the makefile i removed the include dir of the mipsel-linux include dir (-I$(MIPSTOOLS)/mipsel-linux/include )
- in the source files you probably have this : #include <string.h> change it to #include "string.h" etc

this will solve the error you mentioned above, i did had another error with c++ that i could fix, the error(s) where these :
./sokoban.o:(.rodata._ZTI7CPlayer[_ZTI7CPlayer]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./sokoban.o:(.rodata._ZTI5CSpot[_ZTI5CSpot]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./sokoban.o:(.rodata._ZTI4CBox[_ZTI4CBox]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./sokoban.o:(.rodata._ZTI10CWorldPart[_ZTI10CWorldPart]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
./sokoban.o:(.rodata._ZTI5CWall[_ZTI5CWall]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./sokoban.o:(.rodata._ZTI6CFloor[_ZTI6CFloor]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
./sokoban.o:(.rodata._ZTI6CEmpty[_ZTI6CEmpty]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'

these errros came due to the use of a base class with virtual functions... and it was always the same error, you can solve that one by adding "-fno-rtti" the the CFLAGS and do a complete rebuild (prefereably a clean first)

it could also be that certain function(s) are not availible yet, you can just search for another impelemention on google then ...

Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on August 22, 2010, 04:11:09 pm
thanks for the tips joyrider, i will try to modify as you said.
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on August 24, 2010, 05:51:41 am
hum, still have the pb ...
Quote
$ make
mipsel-linux-g++ -G0 -O3 -I/cygdrive/c/cygwin/dingoo_sdk/include  -mips32 -mno-abicalls -fno-pic -Wall -Wextra -finline-functions -fomit-frame-pointer -msoft-float -fno-builtin -fno-exceptions -D_DEBUG -DMPU_JZ4740 -c -o src/emu/Booster.o src/emu/Booster.cpp
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../../../include/c++/4.1.2/cstring:87: error: '::strcmp' has not been declared
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../../../include/c++/4.1.2/cstring:88: error: '::strcoll' has not been declared
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../../../include/c++/4.1.2/cstring:90: error: '::strxfrm' has not been declared
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../../../include/c++/4.1.2/cstring:95: error: '::strerror' has not been declared
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../../../include/c++/4.1.2/cstdio:103: error: '::clearerr' has not been declared
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../../../include/c++/4.1.2/cstdio:107: error: '::fflush' has not been declared
/cygdrive/c/cygwin/mipsel-gcc4.1-nopic/bin/../lib/gcc/mipsel-linux/4.1.2/../../.

And I modified the files with "string.h" instead of <string.h>.

Also, here is makefile :

Quote
# Define the applications properties here:

APP_NAME = dingoo2600

# Define the compiler settings here:

CPP       = mipsel-linux-g++
CC        = mipsel-linux-gcc
LD        = mipsel-linux-ld

SOURCE    = src/emu src      

#INCLUDE   = -I$(DINGOO_SDK)/include -I../lib -I$(MIPSTOOLS)/mipsel-linux/include -I$
INCLUDE   = -I$(DINGOO_SDK)/include

W_OPTS    = -Wall -Wextra -finline-functions -fomit-frame-pointer -msoft-float -fno-builtin -fno-exceptions
CPP_OPTS  = -G0 -O3 $(INCLUDE) -mips32 -mno-abicalls -fno-pic $(W_OPTS) -D_DEBUG -DMPU_JZ4740 -c
CC_OPTS   = -G0 -O3 $(INCLUDE) -mips32 -mno-abicalls -fno-pic $(W_OPTS) -D_DEBUG -DMPU_JZ4740 -c
CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_

LIB_PATH  = $(DINGOO_SDK)/lib
LIBS      = -lfgl -lsml -lm -lc -lgcc

LD_SCRIPT = $(DINGOO_SDK)/lib/dingoo.xn
LD_OPTS   = -nodefaultlibs --script $(LD_SCRIPT) -L$(LIB_PATH) $(LIBS) -o $(APP_NAME).elf

# Find all source files

SRC_CPP = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.cpp))
SRC_C   = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.c))
SRC_S   = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.S))
OBJ_CPP = $(patsubst %.cpp, %.o, $(SRC_CPP))
OBJ_C   = $(patsubst %.c, %.o, $(SRC_C))
OBJ_S   = $(patsubst %.S, %.o, $(SRC_S))
OBJ     = $(OBJ_CPP) $(OBJ_C) $(OBJ_S)

# Compile rules.

.PHONY : all

all : $(APP_NAME).app

$(APP_NAME).app : $(APP_NAME).elf
   $(DINGOO_SDK)/tools/elf2app/elf2app $(APP_NAME)

$(APP_NAME).elf : $(OBJ)
   $(LD) $(OBJ) $(LD_OPTS)

$(OBJ_CPP) : %.o : %.cpp
   $(CPP) $(CPP_OPTS) -o [email protected] $<

$(OBJ_C) : %.o : %.c
   $(CC) $(CC_OPTS) -o [email protected] $<

$(OBJ_S) : %.o : %.S
   $(CC) $(CC_OPTS_A) -o [email protected] $<

# Clean rules

.PHONY : clean

clean :
   rm -f $(OBJ) $(APP_NAME).elf $(APP_NAME).bin $(APP_NAME).app

Any suggestion about that ?
Title: Re: Platform Independant Dingoo SDK
Post by: joyrider on August 24, 2010, 08:16:56 am
yes, make sure all header files are included like "header.h" and not <header> or <header.h> but you probably already did that, also if you use new / other libs, make sure to do that with those libs as well. cause it seems to me your still doing include <cstdio.h> or <cstdio> somewhere as well as <cstring.h> or <cstring>. so with my previous post i ment you should do it for all header files you include...

Also certain functions are not availible yet so you have to find another implementations and add those yourselve...

fflush doesn't exist do on native, actually there is an export i thought but parameters are unknown for it so you can leave that, it flushes changes to the filesystem. Not really good to leave it out but no choise atm..

strcmp exists i think not to sure about the other ones though.. It might be still a header / cpp files somewhere that booster.cpp included where the headers are included using "<...>". I missed some as well and kept getting similar errors (always refering to the mipsel-linux directory)
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on August 24, 2010, 01:25:57 pm
yes, make sure all header files are included like "header.h" and not <header> or <header.h> but you probably already did that, also if you use new / other libs, make sure to do that with those libs as well. cause it seems to me your still doing include <cstdio.h> or <cstdio> somewhere as well as <cstring.h> or <cstring>. so with my previous post i ment you should do it for all header files you include...
No, i was stupid , i did it only for string.h, also i need to change "string.h" to "cstring.h" ?
I will do that this evening (i'm at work currently)
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on August 24, 2010, 02:26:55 pm
error: '::strcmp' has not been declared
We have it but it's a #define to _strcmp, I guess there is or was some kind of conflict

error: '::strcoll' has not been declared
We don't currently have this

error: '::strxfrm' has not been declared
We don't currently have this

error: '::strerror' has not been declared
We don't currently have this

error: '::clearerr' has not been declared
We don't currently have this

error: '::fflush' has not been declared
We don't currently have this, but I think it could be easily implemented with fsys_flush_cache
Please note though that you can not just use fsys_flush_cache directly since we wrap FSYS_FILE* in our own FILE* struct.

EDIT: I just added fflush.
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on August 24, 2010, 06:29:16 pm
ok, thanks also for your reply harteex.
Need to see how to implement such methods in sdk :/
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on August 25, 2010, 05:27:07 pm
I can't say very much about the C++ support but try to add this include to the makefile: -I$(DINGOO_SDK)/include/stlport
Then after you've included that feel free to try both with cstring and string.h

Also about strcmp, I will try to fix this problem.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on August 26, 2010, 07:38:22 pm
One more thing to try, alekmaul.
Try to use all the includes and options djdron uses here: http://code.google.com/p/dingoo-sdk/issues/detail?id=46#c9
(look at comment #9)
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on August 31, 2010, 05:42:23 am
ok, it's better, i have now a few errors i need to check
Quote
mipsel-linux-g++ -c -G0 -O3 -I/cygdrive/c/cygwin/dingoo_sdk/include -I/cygdrive/c/cygwin/dingoo_sdk/include/SDL -I/cygdrive/c/cygwin/dingoo_sdk/include/stlport -Wall -Wextra -finline-functions -fomit-frame-pointer -msoft-float -fno-builtin
-fno-exceptions -mips32 -mno-abicalls -fno-pic -DMPU_JZ4740 -DNDEBUG -D_DINGOO -fno-rtti -fno-threadsafe-statics -o src/emu/Booster.o src/emu/Booster.cpp
In file included from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/iostream:29,

                 from src/emu/bspf.h:44,
                 from src/emu/Event.h:24,
                 from src/emu/Booster.cpp:19:
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_ioserr.h:9:4: error: #error STLport iostreams header cannot be used; you chose not to use iostreams in the STLport configuration file (stlport/stl/config/user_config.h).
In file included from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_stdexcept_base.h:25,
                 from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_ios_base.h:22,
                 from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_ios.h:23,
                 from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_istream.h:27,
                 from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/iostream:43,
                 from src/emu/bspf.h:44,
                 from src/emu/Event.h:24,
                 from src/emu/Booster.cpp:19:
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h:58:60: error: ../include/exception: No such file or directory
In file included from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/iomanip:29,
                 from src/emu/bspf.h:45,
                 from src/emu/Event.h:24,
                 from src/emu/Booster.cpp:19:
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_ioserr.h:9:4: error: #error STLport iostreams header cannot be used; you chose not to use iostreams in the STLport configuration file (stlport/stl/config/user_config.h).
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/config/_dingoo.h:19: warning:unused parameter 'str'
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_new.h: In function 'void* stlpmtx_std::__stl_new(size_t)':
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_new.h:134: error: 'exit' was not declared in this scope
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h: At global scope:
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h:75: error: 'std::exception' has not been declared
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h:79: error: 'std::bad_exception' has not been declared
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h:122: error: 'std::terminate' has not been declared
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h:123: error: 'std::terminate_handler' has not been declared
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h:124: error: 'std::set_terminate' has not been declared
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_ctime.h:36: error: '::tm' has not been declared
/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_ios_base.h:51: error: expected class-name before '{' token
make: *** [src/emu/Booster.o] Error 1

and the makefile now :
Quote
# Define the applications properties here:

APP_NAME = dingoo2600

# Define the compiler settings here:

CPP       = mipsel-linux-g++
CC        = mipsel-linux-gcc
LD        = mipsel-linux-ld

SOURCE    = src/emu src     

INCLUDE   = -I$(DINGOO_SDK)/include -I$(DINGOO_SDK)/include/SDL -I$(DINGOO_SDK)/include/stlport

STD_OPTS  = -G0 -O3 $(INCLUDE) -Wall -Wextra -finline-functions -fomit-frame-pointer -msoft-float -fno-builtin -fno-exceptions -mips32 -mno-abicalls -fno-pic -DMPU_JZ4740 -DNDEBUG -D_DINGOO
CPP_OPTS  = -c $(STD_OPTS) -fno-rtti -fno-threadsafe-statics
CC_OPTS   = -c $(STD_OPTS)
CC_OPTS_A = $(CC_OPTS) -D_ASSEMBLER_

LIB_PATH  = $(DINGOO_SDK)/lib
LIBS      = -lm -lsml -lc -ljz4740 -lgcc -lstdc++

LD_SCRIPT = $(DINGOO_SDK)/lib/dingoo.xn
LD_OPTS   = -nodefaultlibs --script $(LD_SCRIPT) -L$(LIB_PATH) $(LIBS) -o $(APP_NAME).elf

# Find all source files

SRC_CPP = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.cpp))
SRC_C   = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.c))
SRC_S   = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.S))
OBJ_CPP = $(patsubst %.cpp, %.o, $(SRC_CPP))
OBJ_C   = $(patsubst %.c, %.o, $(SRC_C))
OBJ_S   = $(patsubst %.S, %.o, $(SRC_S))
OBJ     = $(OBJ_CPP) $(OBJ_C) $(OBJ_S)

# Compile rules.

.PHONY : all

all : $(APP_NAME).app

$(APP_NAME).app : $(APP_NAME).elf
   $(DINGOO_SDK)/tools/elf2app/elf2app $(APP_NAME)

$(APP_NAME).elf : $(OBJ)
   $(LD) $(OBJ) $(LD_OPTS)

$(OBJ_CPP) : %.o : %.cpp
   $(CPP) $(CPP_OPTS) -o [email protected] $<

$(OBJ_C) : %.o : %.c
   $(CC) $(CC_OPTS) -o [email protected] $<

$(OBJ_S) : %.o : %.S
   $(CC) $(CC_OPTS_A) -o [email protected] $<

# Clean rules

.PHONY : clean

clean :
   rm -f $(OBJ) $(APP_NAME).elf $(APP_NAME).bin $(APP_NAME).app
I will check pbs as soon as possible
Title: Re: Platform Independant Dingoo SDK
Post by: joyrider on August 31, 2010, 11:03:11 am
you should read the errors more closely, it always tells you exactly what is the problem although sometimes in a cryptic manner.

Most of the time i can see what the problem is by just looking at the errors gcc spits out. If i can't i google them, obviously just the error without the your source file and line the error occrured to get an idea of what might be wrong, i always found a solution this way.

the errors you posted do contain some trivial errors that i'd though you'd spotted yoursevlve like :

/cygdrive/c/cygwin/dingoo_sdk/include/stlport/stl/_exception.h:58:60: error: ../include/exception: No such file or directory
In file included from /cygdrive/c/cygwin/dingoo_sdk/include/stlport/iomanip:29,

like erh maybe the file does not exist ??? you forgot some include dirs or your pointing in the headers / sources to wrong files? (at #include statements)

#error STLport iostreams header cannot be used; you chose not to use iostreams in the STLport configuration file (stlport/stl/config/user_config.h).

this one might be trivial, just dispable the use iostreams in the config file and if it's not that trivial i think google might give you answers cause it seems trivial...

the rest of the errors are probably side effects of the ones above, solve one error and you might have solved many after them. I always try to get the trivial ones sorted and most of the time the rest follows :)
Title: Re: Platform Independant Dingoo SDK
Post by: alekmaul on August 31, 2010, 11:35:06 am
yes, i know joyrider, but it's because Harteex said me to use the makefile from sdlpong to test if all is ok.
So i used the same include part than his makefile and that's the result.
I posted it here to inform him of pbs, and as i said in the beginning of my post, i will check the pb ^^
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on August 31, 2010, 12:48:05 pm
Unfortunally, the C++ support does not currently support iostreams and exceptions.
Title: Re: Platform Independant Dingoo SDK
Post by: djdron on September 07, 2010, 10:23:29 am
stlport & libm appeared in SDK due to Stockfish porting (http://code.google.com/p/spartak-chess/source/browse/#svn/trunk/stockfish) :-)
Yes, this is not full C++, but basic stl (string, vector, map) is working.
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on November 14, 2010, 07:20:58 pm
New version released, all users are encouraged to upgrade.
http://code.google.com/p/dingoo-sdk/downloads/detail?name=dingoo_sdk_r285.zip

What's new since r251:
* SDL performance and sound fixes
* SDL samples: SDLPong (C++) & SDL hello world (C)
* fflush added
* fprintf now working
* Various other bug fixes and improvements
Title: Re: Platform Independant Dingoo SDK
Post by: clach04 on November 14, 2010, 07:56:53 pm
New version released, all users are encouraged to upgrade.
http://code.google.com/p/dingoo-sdk/downloads/detail?name=dingoo_sdk_r285.zip

What's new since r251:
* SDL performance and sound fixes
* SDL samples: SDLPong (C++) & SDL hello world (C)
* fflush added
* fprintf now working
* Various other bug fixes and improvements

Great work Harteex, I've been hoping for fflush :-)
Title: Re: Platform Independant Dingoo SDK
Post by: javum on January 09, 2011, 05:21:41 am
any chances of implementing sscanf?  8)
http://boards.dingoonity.org/dingoo-releases/pocketsnes-port-v2-for-native-firmware/msg26101/#msg26101
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on January 09, 2011, 04:40:19 pm
Done.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on February 12, 2011, 12:28:28 am
There's been an important update to the SDK, it can be downloaded from googlecode as usual:
Code: [Select]
Added libmad library for MP3 decoding.
Added smlgui library which provided an on-screen virtual keyboard including sample.
Updated AstroLander with 3D and particle effects.
New install/update system.
Implemented getcwd.

Download Here (http://code.google.com/p/dingoo-sdk/downloads/detail?name=dingoo_sdk_r308.zip)
Title: Re: Platform Independant Dingoo SDK
Post by: Harteex on February 13, 2011, 02:24:03 am
Note, the latest version is now r315:
http://code.google.com/p/dingoo-sdk/downloads/detail?name=dingoo_sdk_r315.zip
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on February 16, 2011, 10:37:51 pm
The latest SDK version (r324) has been uploaded and is available in the usual place:
http://code.google.com/p/dingoo-sdk/downloads/detail?name=dingoo_sdk_r324.zip

Code: [Select]
Updated fgl to support non-power-of-two texture sizes, this fixes the astrolander bonus build.
Replaced internal print and sprintf functions with more robust/standard versions.
Implemented realpath(), rename(), unlink() and partial stat().
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on February 24, 2011, 10:58:33 pm
We now have a wikipedia page, which can be found here:
http://en.wikipedia.org/wiki/Dingoo_SDK

If people can help by keeping it alive and up-to-date then that'd be great.
Title: Re: Platform Independant Dingoo SDK
Post by: protomank on July 27, 2012, 01:38:24 am
Unfortunally, the C++ support does not currently support iostreams and exceptions.

Any tips on how can I get around this, or if there are any progress in porting full C++ support?
My code have lots of iostream and sstrings that would be a bit hard to convert to C-equivalent.
Title: Re: Platform Independant Dingoo SDK
Post by: flatmush on September 11, 2012, 06:05:37 pm
Not much movement on this really, it's one of those things where if you want/need it then you'll need to add it yourself or contact one of the C++ guys specifically, I remember spiller did a lot of C++ stuff way back.

Exceptions can be done in a similar way in C using setjmp, an example of that is:

exc.h:
Code: [Select]
#ifndef __exc_h__
#define __exc_h__

#include <noreturn.h>
#include <setjmp.h>

#ifdef __cplusplus
extern "C" {
#endif

#define try if(setjmp(*_try()) == 0)
#define catch(exc) else if(_catch(&exc))


extern jmp_buf* _try();
extern int _catch(void* exc);
extern noreturn void throw(void* exc);

#ifdef __cplusplus
}
#endif

#endif

exc.c:
Code: [Select]
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>



typedef struct {
jmp_buf env;
void*   ret;
void*   next;
} _exc_t;

static _exc_t* _exc_stack = NULL;



jmp_buf* _try() {
_exc_t* ctx = (_exc_t*)malloc(sizeof(_exc_t));
if(ctx == NULL) {
fprintf(stderr, "Error: Failed to allocate context.");
abort();
}
ctx->next = _exc_stack;
_exc_stack = ctx;
return &ctx->env;
}

int _catch(void** exc) {
if(_exc_stack == NULL) {
fprintf(stderr, "Error: Context stack empty.");
return 0;
}
_exc_t ctx = *_exc_stack;
free(_exc_stack);
_exc_stack = ctx.next;
*exc = ctx.ret;
return 1;
}

void throw(void* exc) {
if(_exc_stack == NULL) {
fprintf(stderr, "Error: Context stack empty.");
abort();
}
_exc_stack->ret = exc;
longjmp(_exc_stack->env, 1);
}

noreturn.h:
Code: [Select]
#ifndef __noreturn_h__
#define __noreturn_h__

#if defined(__BORLANDC__) || (_MSC_VER >= 1310)
# define noreturn _declspec(noreturn)
#elif (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))
# define noreturn __attribute__ ((noreturn))
/*#elif (__cplusplus >= ???)
# define noreturn [[noreturn]]
#elif (__STDC_VERSION__ >= 201ymmL)
# define noreturn _Noreturn*/
#else
#define noreturn
#endif

#endif

As for iostreams I don't understand why fwrite/fprintf would be much harder.
Title: Re: Platform Independant Dingoo SDK
Post by: protomank on September 11, 2012, 08:34:45 pm
It isn't that C file system is harder or anything like that, but my project WAS written in ANSI-C and I rewrote in C++ to be easier to develop and mantain. Returning the code for ANSI-C is a drawback, that while in some parts (like file read/write) is OK, on some others like stringstreams, is really really bad :)