Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
In my current master thesis, I should implement a real time OS (using ucos-ii) with powerpc mpc5200. it also required to add c++ support.
my OS has newlib (libc) and with it I have a full standard c with all input/output functionality.
now when i compile this example with my OS:
Just a thought: cout is most likely a global/static object, which needs to be initialized. I suspect you don't call the constructors of global/static objects on application startup, do you?
Look into th faq if you don't...
But you know, that you have to port a standard c++ library in order to use it? You can't just link your app with the standard C++ library of linux and then execute it under your os.
ok, if yu want to check whether there are static/gobal objects or not, then you can just look at the size of the ctors section in your executable (given that you don't discard that section).
thank for your quick help!!
I call now the global/static objects.
now I don't get any exception. that is good.
but no output come.
note that printf() work but "cout << ..." not !
ok, I looked a little bit into the gnu stdlibc++ source and came up with the following:
in src/ios_init.cpp there is a class constructor called ios_base::Init::Init(), which seems to initialize the cout/cin/* objects. You should check whether this constructor (I'm not yet sure if it is a constructor and if it is belonging to a global/static object) is really called (some printf'ing is sufficient).
Another thing: Did you also implement the placement new (again, look into the faq)? Because this is used quite much by this constructor.