qt / creator: dyld: Library not loaded [duplicate] - c++

I developed one Qt application in Mac using Qt creator,Its working fine on my development machine.Then I copied the project output from my build directory to a new machine without Qt framework,but its not working in that machine, Do I need to install any frame work for running Qt application in Mac. How I can include qt framework in my application when deploying the project output?

Make sure to have read Developing Qt Applications for Mac OS X.

See Qt for macOS - Deployment specifically, and Qt for macOS generally.

The binary will be in your Debug or Release folder and it will be as .app
(.app extension may be hidden )
make sure you copy that and it should work fine as the binary has all its dependencies packed together

Related

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.

Deploying a qt application on Linux

I have read and followed the procedure given on qt website. But I am unsuccessful in deploying my application (on ubuntu 15.10, qt 5.4). I followed many blogs and answers on stackoverflow in vain. (In particular, I tried this)
I downloaded the qt source and built it statically. But I am unable to deploy my application. My application uses "webkit". So I manually built the webkit and webkitwidgets. Then I configured my Qt creator to use the static build of qtversion for building my app. It throws an error
Unknown module(s) in QT: webkitwigets
But I rechecked that webkit and webkitwidgets have been built statically. So, where am I going wrong?
Alternatively, I tried the statifier application, but it always produces a corrupt executable that does not even run on the same system. (Ermine - commercial version of statifier is not an option for me)
How do I deploy this app on linux?

Qt deployment issue (MinGW inside)

I try to deploy a Qt app on a basic Windows 7 Pro SP1 machine.
My app works fine when I run it inside Qt Creator or on any machine with Qt insllated.
I have read a lot of posts and try many different things without success.
Things tried :
Windeploy Qt
Quick and dirty method of Qt Wiki
Add mingwm10.dll
Add libEGL.dll
Check loaded dll with dependency walker
Check loaded dll with Qt Creator debugger
My app crashes when I run it with these two error messages :
This application failed to start because it could not find or load the Qt platform plugin "windows".
This application has requested the runtime to terminate it in an unsual way. Please contact...
This is my current tree (obtained with windeployqt) :
*.exe
*.dll
platforms/qwindows.dll
imageformats/*.dll
iconengines/*.dll
With dependency walker, I have some red lines even if the app runs normally but nothing interesting.
Dev machine info :
Windows 7 Pro Sp1 64 Bits
Qt Creator 3.3.0
MinGW 4.9.1 32 Bits
Qt SDK 5.4.0
I'm probably doing something wrong but what ?!
The executable seems to search something in the Qt base directory because when I rename it the deployed app doesn't want to work anymore.
Need help please ;)
Ok, I found the solution...
I added this line at the very beginning of my main function :
QApplication::addLibraryPath("./");
After that, windeployqt does the job.
I hope it will help someone in the future.

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

Run Mac application of C++ and Qt on another Mac

I am trying run a simple C++ with QT application on another mac. I am trying to avoid having to install Qt on the other mac. This application was created in Xcode with cmake.
Two notes: my application (for some reason) does not create an .app file. It just creates a file with the name of my project (and no extension). I can run this file by double clicking, but still, it is not an .app. Does this matter?
Another thing, I am linking my application to static libraries of Qt. From what I understand, this should allow to run the application even if Qt is not installed, right? The result of running my application on the other mac is simply a terminal window that says: Instruction unknown.