Results 1 to 12 of 12

Thread: How to compile Qt (linux) progect in windows? (runtime error)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to compile Qt (linux) progect in windows? (runtime error)

    Quote Originally Posted by mandarinka View Post
    It seems that it can't... But why? I have this text file in the same directory with .pro, .cpp and .h files. And this directory is on the same disс, where Qt SDK is installed.

    Qt Code:
    1. QFile file("words.txt");
    2. QString str;
    3. QList<QPair< QString,QList<QString> > > list;
    4. if(file.open(QIODevice::ReadOnly | QIODevice::Text))
    5. {
    6. QTextStream stream(&file);
    7. while(!stream.atEnd())
    8. {
    9. str = file.readLine();
    10. ...and store this lines in list
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 
    Qt Creator uses shadow build by default. This is a project specific setting in Qt Creator. It means that Qt Creator will never modify any files below the source tree and all temporary and intermediate files will be created 'out of source'. (I think that is the terminology).

    Your application clearly expects this file 'words.txt' to be present from wherever your app runs. Hint, it is not in the same folder where your .pro file is. Try going up a folder from where your .pro file is and look for a folder named '<your project>-build-desktop'.

    ...
    while I wrote this post Chris edited his, so ignore my rant
    Last edited by schnitzel; 7th March 2011 at 22:56.

Similar Threads

  1. How do I compile for linux on windows?
    By waitingforzion in forum Newbie
    Replies: 4
    Last Post: 28th December 2009, 07:51
  2. port linux app to win (runtime error)
    By agostain in forum Qwt
    Replies: 3
    Last Post: 9th September 2009, 12:45
  3. Project won't compile under Windows (works under Linux)
    By philski in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2006, 15:29
  4. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23
  5. Replies: 4
    Last Post: 12th January 2006, 04:16

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
  •  
Qt is a trademark of The Qt Company.