Results 1 to 3 of 3

Thread: QT Console application QTextStream

  1. #1
    Join Date
    Apr 2010
    Posts
    7
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QT Console application QTextStream

    Hello everyone.

    I try to create a simple console application with Visual C++ 2010 and QT 4.7.0.

    I try to use the QTextStream class to write to the stdout stream.
    Howevery, if the code
    Qt Code:
    1. #include <QTCore>
    2.  
    3. int main(int argc, char** argv) {
    4. QTextStream out(stdout, QIODevice::WriteOnly);
    5. return 0;
    6. }
    To copy to clipboard, switch view to plain text mode 
    is executed, the application crashes on the 4th line with:
    Qt Code:
    1. Unhandled exception at 0x77b08c19 in console.exe: 0xC0000005: Access violation writing location 0x00000014.
    To copy to clipboard, switch view to plain text mode 

    Does someone know this problem?

    Thank you, Louis

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT Console application QTextStream

    Do you use Qt binary build with Visual Studio 2008 (downloaded from Qt website) or did you build yourself the Qt framework with Visual Studio 2010?

    I have the libraries and it give a run-time error with VS 2010, but works with VS 2008.

    I'm now building Qt with VS 2010 and i will reply after i test it.

    Update: my build finished and it works, if you want to test i can send you qtcore4.dll built with VS 2010, or you can build Qt with VS 2010
    Last edited by Zlatomir; 6th November 2010 at 00:07. Reason: updated contents

  3. #3
    Join Date
    Apr 2010
    Posts
    7
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT Console application QTextStream

    Great, thanks. I think i built it myselfe.

Similar Threads

  1. about console application
    By jirach_gag in forum Qt Programming
    Replies: 2
    Last Post: 5th January 2012, 11:39
  2. Writing a Qt console application
    By sashoalm in forum Newbie
    Replies: 6
    Last Post: 7th February 2011, 17:42
  3. Exiting a Qt Console Application
    By nbetcher in forum Qt Programming
    Replies: 4
    Last Post: 23rd March 2009, 21:03
  4. Console application questions
    By Morea in forum Qt Programming
    Replies: 3
    Last Post: 21st November 2008, 19:32
  5. Console application suspense
    By TheGrimace in forum Newbie
    Replies: 6
    Last Post: 1st October 2007, 14:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.