Forum Discussion
Altera_Forum
Honored Contributor
20 years agoIostream Problem
Hi all, I have recently posted a problem in the General Software Forum that I now know applies to more specifically when using the eCos library. Here are the posts: Hi, I have recently been using...
Altera_Forum
Honored Contributor
20 years agoMore information:
If I put in a call to sync_with_stdio() setting it to false, i.e.,int main(void)
{
ios::sync_with_stdio(false);
printf("Hello, eCos world, printf-style!\n");
cout << "Hello, eCos world, cout-style" << endl;
printf("Hello, eCos world, printf-style!\n");
return 0;
} I now get as output: Hello, eCos world, printf-style! fileno() function is stubbed out! write() function is stubbed out! write() function is stubbed out! write() function is stubbed out! Hello, eCos world, printf-style! Implying that the cout is close to working, but that it uses the fileno() and write() functions that I have stubbed out (see earlier post). Does anyone know how to get at the "real" versions of these functions so that I can tie them in? (I believe this makes sense too, because the debug console is the JTAG uart port and would be using the write() function to accomplish the cout.) Thanks, Rennie P.S. I tried the same test using the MicroC/OS-II OS and also could not get the couts to work until I put in a call to ios::sync_with_stdio(false); So, I think I'm on the right track... I just need to find the necessary underlying functions (write(), fileno(), etc?) to get it to work under eCos.