Qt unit-test: why "qmake" is not recognized - c++

I managed to follow this tutorial in order to write my first unit-test.
However, when opening a "cmd-console" from inside my project folder and try to rum qmake, i get the following error:
'qmake' is not recognized as an internal or external command, operable program or batch file.
so, why qmake is not recognized? (note that I am working on windows Vita)

On Windows qt and its tools are installed by default in C:\Qt\blablah. You should add the path to the qmake binary, and that will do the trick. See the instructions here. Note that Qt creator set some variables for its terminal so you use qmake in creator without touching the system.

set path the Qt compiler.
sth like this:
set PATH=C:\Qt\4.8.5\bin
where the 4.8.5 is the version of Qt you installed.

If you don't want to add the QT bin path to PATH you can write the full path to qmake:
>"$(QTDIR)\bin\qmake.exe" -o Makefile odbc.pro
where $(QTDIR) is the full path of the qtbase directory.

Related

Add QFTP module in qt5

i want to install QFTP module in my qt5
I downloaded it from github and i want to know what is the next step, if possible try to be the most explicit because my english is not very good, thanks
Did you try to open qtftp.pro file with QTCreator and then build it?
If this step is completed without errors, you can install the library to the main QT direcotry. Use the QT console window for this, which has all the paths embedded in it.
Go to the directory where you built the library and enter the command mingw32-make.exe install.
After that probably you can use your library in QT Creator by command:
QT += name_of_library

How to use clang 5 with qt in qt creator?

I've configured my locally installed version of clang 5.
and set up a kit with it
but when I do a build with it:
it's clearly still using the system compiler for qmake, which causes a bunch of errors because my code requires C++17 support:
How do I set what compiler qmake is using?
Thank you.
You can do it in your pro file, directly:
QMAKE_CC = /path/to/the/c/compiler
QMAKE_CXX = /path/to/the/c++/compiler
but you'd be better specify the correct Qt mkspec in your kit, which could be something like linux-clang. Check the mkspecs directory, see if in some of its subdirectories there is the right qmake.conf already, if not you can make a new subdirectory in mkspecs and a new configuration file inside it. The mkspecs directory should be in the path given by the terminal command
qmake -query QT_INSTALL_ARCHDATA
Hope it helped.

How to run qmake from the static Qt

For making a very simple Qt app "installable" on other systems, I'm using Qt Installer Framework following this link.
In bottom, in Setting up Qt Installer Framework, number 1 orders to have Qt Installer Framework source code. I downloaded it from here. (qt-installer-framework-opensource-2.0.1-src.zip)
Now I don't understand the next instruction there :(
It says:
2- Build the tools by running the "qmake" from the static Qt, followed by "make" or "nmake".
My question is, first what does it mean?
And from what path?
I don't know how to do it:(
qmake comes with the qt-framework and is a make file generator. (an alternative to cmake).
You call qmake on a .pro file from your project. This .pro file have to contain your source code files project dependencies and more.
Consider that you have a project folder with your source code and the .pro file. Then you call the qmake command in this folder. qmake is an program itself, which you can find in the bin folder of your qt-installation. If qmake is in your path variable, you go to the terminal, navigate to the specific folder and just write:
qmake
After that qmake will create a makefile. Then you could call makeand your program will be build.
I hope my answer helps you. You can learn more about qmake on the website of Qt. Here is also a very good qmake tutorial: klick
edit:
how to call make on windows:
download and install cygwin from
http://www.cygwin.com/setup-x86.exe - 32 bit installer or
http://www.cygwin.com/setup-x86_64.exe - 64 bit installer.
then start the Cygwin terminal (Cygwin.bat) and navigate to your folder and call
make
and that will build your qt-installer!

How configure Qt Creator to compile qupzilla?

Is there any simple way to configure Qt Creator to compile qupzilla in my folder (not in /usr/bin and /usr/lib)?
By default i get "error: ../../bin/libQupZilla.so". If i set the path to my app folder with ldconfig - app is compiled but without plugins. They return errors for example (build/qrc_testplugin.cpp Error 1 or something with locale folder).
OS: Arch Linux 64 bit
QT: Qt5
Also i successfully compile qupzilla-git from AUR with qt5. This means that my problem somewhere in incorrect settings or paths...
Qupzilla: http://www.qupzilla.com/
Solution:
1) Add path to programm "path_to_app/bin" to ldconfig (/etc/ld.so.conf)
2) Check off in Projects "Shadow build" checkbox.
3) Change qmake to qmake-qt5. If I understand correctly, it is not necessary to do. Since in Arch Linux qmake and qmake-qt5 same.
4) In build environment add
KDE true
USE_WEBGL true
If you have libQupZilla (or any library) somewhere else than system library directories, easiest is to edit the .pro file, add line like:
LIBS += -L$(PWD)/..relative-path-to-library-location../
...or use absolute path to the library if you want. You probably already have -lQupZilla there, so no need to add that the 2nd time.
In general, with problems like this in Qt Creator, look at the Compile Output tab (at the bottom of the screen). Find the link command (note: if project uses cmake instead of qmake, you may need to add some switches or something for that to make the command visible), which is the one with all the -L/path and -lfoobar switches, and -o programname outputting the final target. Then look earlier to see in what directory it is being run in. Then look if everything matches, and possibly try to copy-paste and run the command from command line yourself, in the same directory where it is run when building under Qt Creator.

Xcode 4.2 create xcode sample project

I have a task to create xcode4 project. The project will be used by other people to open with xcode4, build it and run. The problem is that we use wxWidgets library and by creating xcode project I have to make sure that it has valid wxWidget library path set.
To get valid wxWidgets lib path using terminal is simple:
wx-config --cxxflags
wx-config --libs
How to configure xcode to call these commands and use it's output to set library path?
Use CMake. You write text script and it generates XCode project on other developer's machine using this script and puts correct local paths into XCode project or Makefile.
To the best of my knowledge you can't configure Xcode to run anything so you need to copy and paste the output of these commands into compiler/linker options manually.