I built a static version of Qt 5.1.1 msvc. but after building there is no qmake.exe and when I execute "qmake" it's not recognized as a internal or external command.
what is the problem?
There's no way the build would succeed without qmake being built and executed numerous times. It's there. Look in your build's bin directory. It won't magically be added to your PATH!
Related
I have created a program in Qt using Qt Creator. When I open it, the message appears "The program can't start because Qt5Cored.dll and Qt5widgetsx.dll is missing from your computer. Try reinstalling the program to fix this problem."
copy required libraries from you Qt installation to the directory of executable.
Have you really got a static compiled version of Qt? and are you statically compiling your project?... if so your output executable will be around 30-40mb.... and it won't be asking you for dlls.
However it looks like you have a dynamically linked output, in which case you need to find all the DLLs that your projects uses. You can get these from the folder:
<installpath>\Qt\5.5\mingw492_32\bin for example (different if you use linux / msvc)
Keep running the program and grab each dll it complains about... or use somthing like dependency walker (a free executable you can find online) to help determine which DLLs you need.
You probably need (For windows, using mingw):
Qt5Widgets.dll
Qt5Gui.dll
Qt5Core.dll
libwinpthread-1.dll
libstdc++-6.dll
libgcc_s_dw2-1.dll
Or the debug version in your case which end in "d" e.g.: Qt5Core.dll (release), Qt5Cored.dll (debug). Note versions may be different for your installation version. Copy these files next to your executable. OR include <installpath>\Qt\5.5\mingw492_32\bin in your path.
You need to add all the required dlls
C:\Qt\5.2.1\mingw48_32\bin\
to your project. https://forum.qt.io/topic/50705/solved-qt3d-executable-error-qt5cored-dll-is-missing-from-your-computer/2 should solve your problem.
I want to create an installer for my Application. So, I have read about Qt Installer Framework and I tested the tutorial example and create the installer and everything work find with the example. But I have a doubt when I try to do the same process for my Application. When I compile the code a folder is created at the same level of my code:
MyApplication (my code)
build-MyApplication-Desktop_Qt_5_4_1_MinGW_32bit-Release (code compiled)
So my questions are:
What files of the compilation do I need to copy into the folder myinstaller/packages/vendor/ recommended by Qt Intaller Framework?
If I have dependencies of Qt like serialport, multimedia, and others, how do I insert these dependecies with Qt Installer Framework?
windeployqt.exe is what you want. Just run that on the command line and give it your executable as the argument. It will automatically copy in all the required Qt libraries and even provide the runtime redistributable installer. Then you can use the binarycreator to generate an installer.
You can put all the dependencies in myinstaller/packages/vendor/data, along with your exe. and eventual additional files. I recommended using i.e. dependency walker for finding all the required dependencies. Some of the binarycreator tutorials on qt are outdated; make sure you use the command
<location-of-ifw>\binarycreator.exe -t <location-of-ifw>\installerbase.exe -p <package_directory> -c <config_directory>\<config_file> <installer_name>
with the appropriate arguments.
I'm trying to build a static application on Ubuntu (if it matters, Ubuntu running in a virtual machine in Windows), following the Qt documentation. Accordingly, I have build the libraries from source, using the configuration from the documentation:
./configure -static -prefix /path/to/Qt
There were no error messages from the build from source. I have tried setting the PATH variable in the build environment to the directory that contains my static build files. I've also tried specifying this path in the .pro file's LIBPATH variable. Nevertheless, whenever I build the application, a call to ldd shows that there are still dependencies to the Qt's dynamic libraries. I'm at a loss to understand how I need to configure Qt Creator to fix this.
You should download sources of interested Qt version, configure for static build and compile them yourself.
I had a kit set up in Qt Creator 3.0.1 that pointed to my cross toolchain. This worked until I ran into a bug in the compiler and now have to upgrade to a newer version.
I've obtained a newer toolchain. I went into Creator, edited my kit, and updated the path to the compiler and gdb binary to point to the new toolchain.
However, when I build my project, it's still calling the old toolchain's compiler.
I've even completely deleted my kit, compiler, and debugger and recreated their configuration, but no joy.
I double-checked the mkspec that is being used, and there is nothing in there with hardcoded paths to the compiler, just things like QMAKE_CXX = $${CROSS_COMPILE}g++. I don't have the CROSS_COMPILE variable set. I did try setting it (in Creator's build environment editor) but no joy there either.
How do I get Creator to use my new toolchain?
EDIT - NEW INFO
I tried running the same qmake command line Creator does when it builds (according to its build output). First, the call to qmake I'm making is returning to the command line without creating a makefile. Here is the command I'm running:
/qt5/bin/qmake /s/src/tfs/porject_dirs/Myproject.pro -r -spec devices/linux-am335x-g++ CONFIG+=declarative_debug CONFIG+=qml_debug
So, I added a -d to get some qmake debug output. I found some fishy lines that pointed to some files that are in my mkspecs directory.
What are these files that were installed when I built Qt?
qconfig.pri
qdevice.pri
qfeatures.pri
qmodules.pri
Three of the four (not qfeatures.pri) include in them hard coded paths to the compiler I used to build Qt. I suspect that these are my problem.
Why does Qt Creator allow a compiler to be specified if these files might be overriding it? Is it safe to edit these files? Do I have to rebuild Qt simply to change the compiler used to build my application?
There is, an open bug in Qt that leaves hardcoded paths in the .pri files mentioned in my question.
Update
The bug has been resolved.
I have ported an existing Qt4 application Qt5 and added some extra (simple) functionality to this application.
The old application came with
libgcc_s_dw2_1.dll
libusb-1.0.dll
mingwm10.dll
QtCore4.dll
QtCored4.dll
QtGui.dll
Now, from QtCreator I am able to run my modified application, but problems occur when preparing deployment. I have used dependancy walker on my .exe and included a load of DLL's in my executables directory.
icudt51.dll
icuin51.dll
icuuc51.dll
IEShims.dll
libgcc_s_dw2-1.dll
libGLESv2.dll
libstdc++-6.dll
libusb-1.0.dll
libwinpthread-1.dll
mingwm10.dll
Qt5Core.dll
Qt5Cored.dll
Qt5Gui.dll
Qt5Guid.dll
Qt5Widgets.dll
Qt5Widgetsd.dll
QtCored4.dll
(Yes, the project size is now extremely large due to the DLL's, but in my use case this is not an issue.)
And finally it didn't complain about missing DLL's. The error message posted when trying to execute the .exe is:
The procedure entry point ?testBit#QBitArray##QBE_NH#Z could not be located in the dynamic link library Qt5Core.dll
I have never tried executing a Qt application outside Qt Creator, so I have really no idea what to do.
If it helps:
Under Projects-> qmake build config : Release -> Effective qmake call I have
qmake.exe D:\Product\test_util.pro -r -spec win32-g++
If any more information is required to make anything more clear, please leave a comment about it.
I had the same problem on Qt 5.4.2 after slightly modifying my code to add new functionality depending on OpenGL. What I did was use Qt's Window's Deployment tool.
Create a folder and place your binary in it
Using cmd issue the following command depending on which version of binary you have:
windeployqt --release Name_Of_Binary
windeployqt --debug Name_Of_Binary
Depending on which version of Qt Creator you have, you might have to manually copy the lib*.dll's to the directory. This bug is not present in Qt 5.4.2 but was present in earlier versions.