You should see the string in the "Application Output" tab in Qt Creator, just like on Windows.
Cheers,
_
You should see the string in the "Application Output" tab in Qt Creator, just like on Windows.
Cheers,
_
Hi there,
No nothing in the "Application Output" tab.
Nothing in the console either.
If I change the program to add
#include <stdio.h>
...
printf("Hello again\n");
there is no visible effect.
What's more I have uninstalled QtCreator and it asked me to uninstall "debug symbols for Qt Creator"
I also uninstalled Qt Linguist and Qt Designer.
Then I reinstalled Qt Creator.
The application still displays nothing.
One possible cause: Qt Creator does not cooperate well with every Linux terminal. Check the terminal setting and make sure that it is xterm -e and not econsole -e or something similar. Try again (try the printf() first).
I have solved this in Debian but I have got an error output in "Application Output" window at least. The Creator tried some piping somewhere and failed. Setting the console to xterm solved the problem.
Thanks,
Could you be more explicit on how you change a terminal setting?
Tools -> Options -> Environment
Thanks Radek. This solved the problem.
I put xterm -e instead of the initial x-terminal-emulator -e
The trouble is that this part of the options is very obscure, no drop down list.
Advice :: remember to always use qDebug()<< function for output in ubuntu/linux because cout<< works only in windows and not in ubuntu/linux
Last edited by MI; 28th February 2014 at 19:58. Reason: updated contents
Umm, no... std::cout is a standard part of the C++ library and is fully functional in both environments.
ChrisW67:: i tried cout<< in ubuntu and it didn't work thats way i made this wrong conclusion but when i tried it again and it worked .... see this is what happens when a newbie gives advice he spoiled it all by saying something stupid
Another advice this time its not wrong::qDebug()<< is for outputing std strings and QStrings but cout<< is only for outputing std strings
so thanks chrisw67 for correcting my mistake
Just one more thing :: i noticed that in linux ubuntu if i dont use endl after cout<< statment the output doesn't show up ... so i googled it up and i foundout that it has somthing to do with flushing the buffer and apparently in windows this is done for you by the os(automatique buffer flushing) but not in ubuntu(no automatique buffer flushing) so you have to use endl after every cout<< statemnt to view the output when in ubuntu and here is a link that explains it all :
http://stackoverflow.com/questions/4...ing-the-buffer
Last edited by MI; 15th March 2014 at 09:52. Reason: spelling corrections
No and it isn't in general. It's about buffered I/O. There is a buffer between your app and the output device (for example, cout). As you write on the device, the output isn't written immediately but it is collected by the buffer. When the buffer is full, it is really written and then cleared so that it can get subsequent output. This is because of speed, the output device need not be fast.
The buffer is written immediately if you command flush(). flush() is also made when you are closing the device. On line-oriented devices, (for example cout), it is often made when you command EOL but in general, don't rely on it. Make flush() every time you need to have all so far output on the device right now. You can cout.flush(); or cout << flush;
Bookmarks