Hi,
I am getting error in
QTextStream cout(stdout);
Though its getting complied but giving error while executing.
http://cartan.cas.suffolk.edu/oopdoc...tfirstapp.html
Can anyone help me how to correct it?
Regards and Thanks,
Kaushik
Hi,
I am getting error in
QTextStream cout(stdout);
Though its getting complied but giving error while executing.
http://cartan.cas.suffolk.edu/oopdoc...tfirstapp.html
Can anyone help me how to correct it?
Regards and Thanks,
Kaushik
Last edited by kaushik_acharya; 7th April 2009 at 14:49.
If you want someone to help you, provide more details. What's the error message? We can't just guess it.
You have to run a level 3 diagnostic.
Ashes to ashes, Qt to Qt ( wysota )
Hi,
First of all sorry for giving incomplete info about the error in my previous post.
I am getting this error:
"Unhandled exception at 0x7c918fea in qt_test.exe: 0xC0000005: Access violation writing location 0x00000010."
when it reaches the line:
QTextStream cout(stdout);
and it stops in a file called _file.c
in this line:
EnterCriticalSection( &(((_FILEX *)pf)->lock) );
inside the function
void __cdecl _lock_file
Last edited by kaushik_acharya; 8th April 2009 at 09:08. Reason: updated contents
Hi,
I had copied this code from the online book as it is. Has anyone tried running this code?
Regards,
Kaushik
Works for me in Linux
Hi,
the code's working fine in Linux.Am using Qt 4.4.3 on Fedora.
Better to put the code here,then more people are likely to test it out and tell you if they get any errors or can make sense of the errors you got.
fac1.cpp
Qt Code:
#include <QtGui> int main (int argc, char* argv[]) { // Declarations of variables int answer = 0; do { // local variables to the loop: int factArg = 0; int fact(1); "Factorial of:", 1); cout << "User entered: " << factArg << endl; int i=2; while (i <= factArg) { fact = fact * i; ++i; } .arg(factArg).arg(fact) .arg("Do you want to compute another factorial?"); } return EXIT_SUCCESS; }To copy to clipboard, switch view to plain text mode
fac1.pro
Qt Code:
TEMPLATE = app SOURCES += fac1.cppTo copy to clipboard, switch view to plain text mode
If everything seems to be going well, you have obviously overlooked something.
http://lists.trolltech.com/qt-intere...ad00855-0.html
...check out this thread.It's a bit similar to your query and might give you some idea.
HTH.
If everything seems to be going well, you have obviously overlooked something.
@rishiraj,
This webpage tells about using the visual studio debugger. I am using that and that's how I pointed out the error.
The program is running if i use std::cout instead of QTextStream cout
Is this some problem with visual studio?
Regards,
Kaushik
Bookmarks