Results 1 to 7 of 7

Thread: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

  1. #1
    Join Date
    Sep 2008
    Posts
    17
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

    Hi all,

    I have a qt based application (named as qtapp) on Ubuntu. The application uses Cg and OpenGL graphics libraries. I compiled the application using shared libraries.

    I followed instructions from web on deploying qt applications step by step:
    1. copy the executable file qtapp,
    2. copy the dependent libs (got lib info using "ldd qtapp"),
    3. create a sh file (named as vis.sh) to let qtapp find dependent libs.

    The function of my application is to read a gzip raw 3d image data file and then render this data in a qt window.

    When I copy the executable file qtapp with dependent libs together to another Ubuntu PC and run the vis.sh file, the application says that "The file could not be read". The qt window is also blank. It means that the qtapp did not read the 3d image data file and get it to render.

    I think my problem is similar to this link:
    http://www.qtcentre.org/threads/1754...qt-on-other-pc

    But I did not use any plugins, I only use zlib for gziped raw data. Would you please help me how to solve this problem?

    Thank you very much!

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

    Since it is your application that says the error message you should be able to instrument it and make it tell more about the problem: where in the code does the error occur, does the app even find the file or does the error mean that it for some reason cannot open the file for reading, or that it thinks that the file is of a wrong format, etc.

  3. #3
    Join Date
    Sep 2008
    Posts
    17
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

    Quote Originally Posted by mvuori View Post
    Since it is your application that says the error message you should be able to instrument it and make it tell more about the problem: where in the code does the error occur, does the app even find the file or does the error mean that it for some reason cannot open the file for reading, or that it thinks that the file is of a wrong format, etc.
    Thank you!

    Q:where in the code does the error occur,
    A:When the program load the 3d image data file, it says that the file could not be read.

    Q:does the app even find the file or does the error mean that it for some reason cannot open the file for reading, or that it thinks that the file is of a wrong format,
    A: I think the error means that it for some reason cannot open the file for reading. I use gzip file and so use zlib lib.

    By the way, the application works fine inside the building folder on my own computer.
    When I copy the executable file and sh file to another new folder that is not in building folder, the application also does not work correctly same as on another computer.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

    Where does the message come from? Your own code or some external library? Show us the code that triggers the message.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Sep 2008
    Posts
    17
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

    Quote Originally Posted by wysota View Post
    Where does the message come from? Your own code or some external library? Show us the code that triggers the message.
    The message is displayed inside my console text window. It is not from my code, I think it is from some external library.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

    What is the code triggering the message?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Sep 2008
    Posts
    17
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.

    Quote Originally Posted by wysota View Post
    What is the code triggering the message?
    hi, I just solved the problem following your questions for me! Although you did not directly provide me the answer, your questions step by step guided me to find what the problem is.
    It is because that I did not copy the Cg shader files used in the application. The application cannot find shader files, so it said "The file could not be read". Thank you all very much for your kind help! It is really a silly ignorance.

Similar Threads

  1. Replies: 8
    Last Post: 5th November 2012, 09:43
  2. Replies: 32
    Last Post: 26th August 2012, 00:10
  3. Replies: 1
    Last Post: 28th November 2010, 18:16
  4. Replies: 9
    Last Post: 20th May 2010, 10:55
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58

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.