How to compile a project including all Qt needed libraries, QtCreator, Linux?
First, I am sorry about my English. That's not m开发者_开发知识库y language.
I am developing an application in QtCreator, Linux. When the IDE asked me about the libraries I would use, I just leave the selected ones (they was not enabled for unchecking). Now, I have to run the compiled file in RedHat 5, but it doesn't run. It tells "Error while loading shared libraries: libQtGui.so.4: ...". So, how do I fix this problem?
I should not install Qt libraries in RedHat (it's a server). I prefer to compile the Qt project including needed Qt libraries (into self compiled file, or in the same directory).
Please, can you tell me some idea??
If you cannot install qt you have two main alternatives:
- Deploy the libraries together with your application (how you do this depends on the way you deploy your application. It may suffice to do a manual copy.)
- Statically link with the qt libraries. They will then be included in your executable (which will be much larger as a result). Static linking
Some pros and cons of static vs dynamic linking are discussed in this thread.
精彩评论