Results 1 to 3 of 3

Thread: file not found... and a... well... newbie solution...

  1. #1
    Join Date
    Nov 2009
    Location
    Belgium
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default file not found... and a... well... newbie solution...

    Hi,

    I just want to share this...

    Have been breaking my head on the reading of a simple ascii file...

    Prgram kept not reading anything. Using "qDebug() <<..." all I got was file not found. The file WAS in the same directory as the sources...

    I looked for it during 2 nights. I searched the forum here, but "file not found" is rendered in "file -found" as search query, so that doesn't give what you're looking for.

    Then, during a short moment of enlightment, I copied the file ("a.txt") to the debug directory (where the exe file is found) and tadaaa! The debug window spit out all of the information that I was hoping to see...

    greatness...

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: file not found... and a... well... newbie solution...

    it's nothing special. debug dir it is work dir, because exe-file is located in that dir.
    the dir where are your sources located, is project dir.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: file not found... and a... well... newbie solution...

    Been there, done that Maybe not for quite as long as you have, but it still had me head butting the table

    What makes it event worse is that under QtCreator, the programs working directory at runtime is the "Debug" or "Release" folder, whilst when running under Visual Studio (my other dev environment) it isn't. If you go into the Debug or Release folder with your file manager and run the exe yourself, then that dir is your working dir, but if you run it from the IDE, then the project dir (the dir with all your sources is) is your programs working dir.

    Grrr... Why does everyone do it differently!

Similar Threads

  1. "Cannot run program "C:\Qt\4.3.3\bin\qmake": file not found
    By PeteH in forum Installation and Deployment
    Replies: 1
    Last Post: 7th February 2009, 00:48
  2. QSqlDataBase file not found
    By sdastagirmca in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2009, 07:53
  3. Visual Studio 2005 Express
    By Muzz in forum Installation and Deployment
    Replies: 22
    Last Post: 6th November 2008, 06:21
  4. Program crashes with assert error in xcb_lock.c
    By Valheru in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2007, 19:56
  5. KDE 3.5.0 crash while opening project
    By MarkoSan in forum KDE Forum
    Replies: 2
    Last Post: 19th October 2007, 16:21

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.