I am trying to understand 'qmake' by following this tutorial . but when I come the the following command:
qmake -o Makefile hello.pro
my command line console shows me this message:
'qmake' is not recognized as an internal or external command, operable program or batch file
I understood that qmake is part of Qt creator and thus it should be executed whenever I run it within my project's folder. so, why it is not recognized ?
In the start menu entry that was created by the installer for Qt, you should find an item that opens a command prompt with all the needed environment variables (including the PATH) already set. For my Qt 5.0.2 install using MingW, it is called "Qt 5.0.2 for Desktop (MinGW 4.7)".
On Windows, you can add path to qmake to PATH or run qmake from directory where it placed, or use absolute path.
Sorry my friend, i donĀ“t speak English very well.
In Qt 5.10.1 I resolved this problem running the command prompt in the next path, C:\Qt\5.10.1\mingw53_32>, after you need change the directory where is the file hello.pro and run the commnand qmake -o Makefile hello.pro after you can see the makefile in the respective folder.
Related
I have a problem that I cannot solve, When I run the executable of my program it gives me the following error:
The code executable cannot continue because libgcc_s_seh-1.dll was not found. To fix the problem, try reinstalling the program
I tried to manually copy and paste the file (libgcc_s_seh-1.dll) into the folder where I keep the executable but I get the following error:
The application could not be started correctly (0xc000007b)
Additional information:
I use windows 10 64 bit
I Use mingw81_64
I use version 6.1.2 of Qt
What can I solve the problem?
I guess you double-clicked in exe file that provides after building in release mode :
For Deploy and create Exe output with QT in windows you should follow this way:
put your compiler path in your system path. now you use mingw81_64 you should set it. something like Qt/tools/mingw81_64/bin
copy exe file that provides after building in release mode in one folder and run mingw81_64 cmd (it has separate cmd)
and cd to that folder path
windeployqt app.exe
This command will get all dll needs for your app and your exe will work .
if you use qml
windeployqt --qmldir (the path of its directory ) app.exe
and also see these youtube videos for more info:
https://www.youtube.com/watch?v=LdSTgR0xJco
https://www.youtube.com/watch?v=hCXAgB6y8eA
For specific error of libgcc_s_seh-1.dll was not found, please try to copy libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll into your compiler path like Qt/tools/mingw81_64/bin.
You should copy libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll into your exefile path after executing windeployqt.exe with all files are in correct version.
I'm trying to build a CMakeLists project using Qt Creator 4.8.1. The problem is, I need to run CMake inside a different nativesysroot.
I tried to create a bash script that runs CMake inside the other environment and added it to my kit. As follows:
#!/bin/bash
cd ~/Desktop/Workspace/my_proj/build &&\
~/Desktop/Workspace/my_proj/sdk-x86_64/opt/nativesysroot/usr/bin/sysroot\
~/Desktop/Workspace/my_proj/sdk-vmwx86-x86_64/opt/nativesysroot/usr/bin/cmake "$#"
Such that, sysroot is an executable that changes the current nativesysroot.
The problem is this does not work because Qt Creator is trying to run CMake using the following configuration:
Running "/home/***/Desktop/Workspace/my_proj/script.sh -E server --pipe=/tmp/cmake-.ewYqvn/socket --experimental" in /tmp/QtCreator-kruzfX/qtc-cmake-YOZsCIQx.
This of course causes CMake server connection lost. I tried the look around how to disable the CMake running in server mode but I did not find anything in Qt Creator.
My question is, how to disable CMake in server mode? Or, how to instruct Qt Creator to run my script without adding any flags or options?
Thanks.
I have application which uses QFtp class.I have made in Qt 4 version.
But now i want to complie QFtp classe in Qt5 but it's showing some error like:
'QFtp' doesn't name and type.
how to resolve this issue. I don't want to use QNetworkAccessManager. is there any way to this?
Thank you
For the sake of completeness, the steps to use the add-ons are:
Download the sources for the add-on from https://github.com/qt/qtftp
Extract the sources somewhere (e.g. Qt5.x.y/Src/qtmyaddon)
Open a console in that folder
Read readme.txt and run the appropriate commands with the latest QT version
Run qmake
Run make (or nmake or mingw32-make or whatever)
Run sudo make install (nmake install, mingw32-make install, ...)
In the .pro file of your project, add "QT += myaddon" (e.g. "QT += ftp")
Run qmake on your project
Compile your project
I followed these instructions in the configuration of OpenCV SDK for using it in Qt Creator IDE, but I couldn't conclude point 6.5, due to configuration errors in Cmake-GUI. I setup the configuration in CMake of the compilers gcc and g++ contained in Qt folder for MinGW32, and all looks Ok. But when Cmake-GUI starts the process of build configuration it ends up saying
"Error in configuration process, project files may be invalid".
It can't find the following:
QT_QMAKE_EXECUTABLE;
Qt5Concurrent_DIR;
QT5Core_DIR;
QT5Gui_DIR;
QT5Test_DIR;
QT5Widgets_DIR.
After this issue I tried to go on with following points of configuration tutorial, without reaching the final instruction of mingw32-make install. I'm using the following versions of softwares: Qt 5.3.0, OpenCV 2.4.9, CMake 2.8.12.2. My OS is Windows 7.
How can I recover the missing Qt files in CMake configuration?
Is there an alternative way for configuring OpenCV with Qt (like using precompiled build of OpenCV libraries)?
You just need to indicate CMake the correct paths to each one. Click oh the path to browse and set each one individually:
QT_QMAKE_EXECUTABLE;
For this one, you need to search inside the Qt installation folder for the /bin directory. On it, you' ll find the qmake.exe. In my case it was C:/Qt/5.3/winrt_x64/bin/qmake.exe
All the following ones are in the Qt's /lib/cmake directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake :
Qt5Concurrent_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Concurrent
QT5Core_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Core
QT5Gui_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Gui
QT5Test_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Test
QT5Widgets_DIR.
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Widgets
Then click generate. It' ll show a new error and ask you for the QT5OpenGL_DIR. Just as before, show CMake the correct directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake/Qt5OpenGL. Finally, click Configure again, and then Generate, and now you're done creating the build files.
You have to specify the location of Qt manually by passing it as an argument for QT5Core_DIR. Qt5_DIR or CMAKE_PREFIX_PATH does also the trick.
Example
Given your Qt 5 is installed at /opt/selfcompiled/Qt5. When calling cmake, add the flag from above:
cmake -DQt5_DIR=/opt/selfcompiled/Qt5 <pathToSourceDir>
Once the Qt 5 directory is set and found by CMake, all the other variables related to Qt 5 should be found from there, too.
I need to have a cmd build script to address x86 x64 compilation issue associated with the IDE (i mean switching qt versions & rebuilding). The problem is that, in my .pro file, I add dependency on external library in this way:
LIBS += ../Libs/SomeExternal.lib
Now when I build this project from QtCreator, everything compiles and builds fine, but when I try to build using command prompt + qmake I get the following linker error:
LINK : fatal error LNK1104: cannot open file '../Libs/SomeExternal.lib'
I understand that this issue is related to paths, but I don't know how to let LINKER.exe see the location where my project is located. Just like QtCreator does.
I try to build using the following way:
I run VS command prompt. I'm using MSVC compiler.
I type qmake.exe -project C:\ProjectPath\Project.pro
nmake
Thanks
Use:
LIBS += -L$${PWD}/../Libs -lSomeExternal
From the documentation:
The PWD variable specifies the full path leading to the directory
containing the current file being parsed.