Is there a way to run Qt(c++) based program without Qt installed? - c++

I have a Qt project already finished. It runs well and everything.
However, I don't know how to run it on a computer that does not have Qt installed.

You must build your QT libraries statically and thus build your app statically, go here for more information.

Related

Qmake on Windows

I have a project written in Qt that I have no problems compiling and running on Linux. The command line is:
qmake ../trunk/GSDTesting.pro
The process on Linux was really simple: install a few dependencies using apt and you are off.
My task is to recompile the same program on Windows using Visual Studio C++ compiler, but the problem is I don't know how to start. There is no such thing as qmake for Windows.
Can someone give me a few hints where to start. Please note that I don't know QT almost at all, my task is just to debug some issue unrelated to QT.
Are you using terminal exclusively on Windows? If so, maybe this image of example build steps straight from Qt Creater 4.14.2 may help you:
As you can see the image of the default Qt creator build steps list the file path where 'qmake.exe' can be located on a local installation of the toolchain.
If you can use a machine with a display I find using the Qt creator GUI is not all that bad.
Here is a link to the base get started page:
https://doc.qt.io/qt-5/gettingstarted.html
Here is a link to the installer download page:
https://www.qt.io/download
IMPORTANT:
You will need to make a Qt account, login to your account, and then download the open-source version of the API. The commercial version of the same source is acquired differently/seperately.
Otherwise, if you cannot use the GUI, can I request some clarification on why you cannot use Qt creator on your Windows installation?

No SSL access from Qt C++ application run outside of QtCreator but access running inside it?

I am running Linux Mint 18.3 and QtCreator (Qt version 5.15 installed from Qt installer download from Qt site, not repository binaries for the distrubution) and developing a C++ GUI application. Because of the openSSL mismatch between native Mint SSL version and that used by Qt5.12 onwards, I have installed the OpenSSL1.1.1d binaries via the Qt Maintenance Tool and have explicitly added these libraries to my application project.
Without this step nothing works. With this step, my application runs successfully when initiated WITHIN QtCreator, but not when I just run the binaries outside of it.
I know that I must be missing something simple here, but what is QtCreator doing that enables access to SSL? I have tried creating simlinks to these libraries (libcrypto.so.1.1 and libssl.so.1.1) locally within the binary directory but this has no effect.
I would like to be able to run my application without having to do so inside of QtCreator but so far I can find no workaround to allow this. Can anyone suggest what I am missing?
I can confirm that the output of calls to my QSslSocket::sslLibraryVersionString() function are returning empty string and "OpenSSL 1.1.1d" respectively, so I am convinced this is a runtime linking problem.

Can't run Qt program on another computer

I have copied my qt C++ program into another computer running the same Ubuntu version but it did not work. The terminal told that it can't find the:
libQt5PrintSupport.so.5
libQt5Core.so.5
libQt5Widgets.so.5
libQt5Gui.so.5
I then installed the qt essentials and qt base and afterwords verified that these libraries were installed but still got the same errors.
Then I tried to install the Qt creator itself but it gave me errors considering pre-build C++ files like function multiple definitions (of course no such errors on my computer)
While on my computer I even didn't have to use the LD_LIBRARY_PATH
Please help
Solve my problem:
The thing is that all Qt programs are hardware dependent and not software dependent like CODE::BLOCKS (thus will need dependencies externally)
What you have to do is install the Qt Creator and recompile your program, but wait it wont be that easy what you have to do is in the project tab disable the output folder ao that the program will be executed internally then enable the output folder and say yes so that you will rewrite your output folder

How to make a standalone mac app using qtcreator

I have build an app using C++ and Qt on QtCreator. The result is a .app file.
Now, when I am running it from the Qt Creator it is running fine.
But when I am running it on a different machine (with no Qt installed) it is not running.
I have figured out the reason is because my .app file is not deployed properly (as there is no framework folder added in the .app)
But I am now having trouble solving it. I am following this link but not getting anywhere as it for console purely.
Is there a way I can fix it using Qt Creator?
A Qt application relies upon Qt's libraries, which must be shipped with the application, inside the built application bundle. The steps for deploying a Qt application for OS X are detailed in the documentation.
If you're not using any other libraries, besides those of Qt, you just need to run the tool macdeployqt, which is part of the Qt installation, in the bin directory. You can set this up to run as a build step in Qt Creator, but I suggest only doing it before you actually deploy the final bundle to another machine.
Calling macdeployqt will copy the necessary Qt frameworks into the bundle and setup the paths to the frameworks so that the binary in the bundle knows where to find them.
If you use any other frameworks or libraries, you need to copy those yourself and set the references to them using install_name_tool

Error while trying to run a release build of a Qt application on Windows

I'm trying to build the Windows version of my app. The program compiles and runs fine on Qt Creator but when I try to run it standalone it throws the following error:
The procedure entry point _Z17qt_message_output9QtMsgTypePKc could not be located in the dynamic link library QtCore4.dll
I have all the necessary dlls in my application folder and they are the same ones that came with the binaries I've downloaded from the Qt's website. This error is driving me crazy for I can't seem to find any reason for it. The application runs fine on Linux and MAC OS X.
Ok I found the problem. I was copying the wrosng dll (not sure why Qt ships with 2 different versions).
The right ones are in:C:\Qt\2010.05\qt\bin and NOT in C:\Qt\2010.05\bin
I hope this helps anyone who might stumble upon this issue.