Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I am quite new to Qt and I am having some basic problems. Sorry to ask trivial questions. I am working on project called seforta. When I created the project with Qt creator two new folders have been created: 1) seforta and 2) build-seforta-Desktop_Qt_5_0_2_GCC_64bit-Debug
If I run the project through Qt creator everything works fine. Now it's time to distribute the software. How can I do? In the seforta folder I have all my .cpp, .h and the .pro files. At the beginning I just entered the seforta folder and run qmake in order to have a Makefile created and then make all. The executable seferta was created. If I try to launch this executable wierd behaviour are observed and a segmentation fault error is released at some point. When I came back to Qt creator and rebuild I got an error QtGui/QtAction not such file. Copying all the files from the build-seforta-Desktop_Qt_5_0_2_GCC_64bit-Debug folder to the seforta folder (and therefore replacing all the files created upon running qmake a make all in this folder) solved the problem. Sorry! I know! I did quite a mess.
Anyway now I have my project working from Qt creator and all the source files in the seforta folder. Let's say I want to compile the software on a different computer which file should I move and what to do in order to compile the software in this new computer?
Thanks a lot for your help
koahnig last edited by
Basically you have to distinguish between "debug" and "release" versions. The folders "build-..." are shadow folders created by qt creator to help to distinguish between those versions, which are separated by the names.
For deployment to another computer you need the executables "*.exe" and typically a bunch of dlls. Some are native from your OS, some are from the compiler, some are from Qt and possibly some are from your own application in case you are already as far. You need all dlls, but typically the native OS ones you do not have to take care of.
For identification the "dependency walker as described on this page":http://qt-project.org/wiki/Show_library_dependencies#aea23489ce3aa9b6406ebb28e0cda430 is helping you.
[edit, sorry was not completely focused and assumed windows platform, but this is not completely clear, koahnig]
Alek Śmierciak last edited by
take it easy.
Your project called 'seforta' will be placed in a 'seforta' folder under your chosen workspace directory. As per qmake recommendations, any builds (release, debug, any other you specify) that you will create through Qt Creator will be placed on the same level as 'seforta' folder, bearing names similar to "build-<PROJECT NAME>-<BUILD NAME>-<QT VERSION>" when default - you can customize them when creating the project in Qt Creator.
You should not move any files to or from build folders. They are moved there from the project folder when building (it's an automated process).
When talking about deployment, you need to specify what kind of output you want. I assume you are using Linux, in which case .deb package may be preferable, but it is not necessarily true.
Try reading this article: "Deploying a Qt5 Application for Linux/X11: Personal Experience":http://qt-project.org/wiki/Deploying_a_Qt5_Application_Linux and also this one: "Deploying an Application on X11 Platforms":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-x11.html.
I am actually using linux. Thanks koahnig anyway for your help. Thanks a lot also to you Alek Śmierciak, since your links are very useful and I am working now by following their advice. To be honest when I tried to develop software in Qt I thought the compilation part would be easy. I believed that any computer with Qt libraries installed could just run qmake and make all in order to have a suitable executables. Of course my difficulties are mainly due to the fact I am not a "real" software developer and my knowledges are still quite scarce. I hope to sort everything out after following the linked guides and turn the thread status in "solved" as soon as possible.
In the meantime thanks guys again!
Unfortunately something went wrong. I downloaded the Qt library again and typed the following commands in according to the guide:
./configure -static -prefix /path/to/Qt <other parameters>
after launching the configure command I received an error that I overcome by adding -qt-xcb. After configure finished (it took ages) I tried to run the make sub-src command but no sub-src rule was present in the makefile. I tried to run just "make" and received the following error:
make: *** [sub-app-make_first-ordered] Error 3
make: Leaving directory
/home/salvo/Downloads/qt-everywhere-opensource-src-5.0.2/qtmultimedia/examples/multimedia/spectrum' make: *** [sub-spectrum-make_first] Error 2 make: Leaving directory/home/salvo/Downloads/qt-everywhere-opensource-src-5.0.2/qtmultimedia/examples/multimedia'
make: *** [sub-multimedia-make_first] Error 2
make: Leaving directory
/home/salvo/Downloads/qt-everywhere-opensource-src-5.0.2/qtmultimedia/examples' make: *** [sub-examples-make_first] Error 2 make: Leaving directory/home/salvo/Downloads/qt-everywhere-opensource-src-5.0.2/qtmultimedia'
make: *** [module-qtmultimedia-make_first] Error 2
what am I doing wrong?