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!
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.
Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.
Quote:
Originally Posted by
mvuori
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.
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.
Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.
Quote:
Originally Posted by
wysota
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.
Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.
What is the code triggering the message?
Re: Deploy a Qt application and get error of "The file could not be read" on Ubuntu.
Quote:
Originally Posted by
wysota
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.