Questions tagged [qmake]

`qmake`, part of the Qt framework, is a tool for generating Makefiles and IDE project files.

qmake, part of the Qt framework, is a multi-platform tool for generating GNU Makefiles, Microsoft Visual Studio project files, and Apple XCode project files from a common .pro project file.

Among other features specific to the Qt framework, qmake automates the process of running moc on source files that contain the Q_OBJECT macro.

qmake manual can be found here for Qt 4.8 and here for Qt 5.

1727 questions
146
votes
11 answers

qmake: could not find a Qt installation of ''

I have a software in ubuntu that requires me to run qmake to generate the Makefile. However, running qmake gives back this error, qmake: could not find a Qt installation of '' I have installed what I thought to be the required packages using, sudo…
Curious
  • 5,533
  • 6
  • 33
  • 63
110
votes
10 answers

How to specify different Debug/Release output directories in QMake .pro file

I have a Qt project and I would like to output compilation files outside the source tree. I currently have the following directory structure: / |_/build |_/mylib |_/include |_/src |_/resources Depending on the configuration (debug/release), I…
Etienne Savard
  • 4,553
  • 6
  • 29
  • 45
106
votes
9 answers

How to create a subdirectory for a project QtCreator?

I would like to divide my Qt project into several directories because it is growing pretty large. However, when I click on browse in QtCreator, there is no 'Add directory' and no such thing in 'Add new'. Can this be done somehow?
gruszczy
  • 37,239
  • 27
  • 119
  • 167
90
votes
3 answers

Qt: *.pro vs *.pri

What is the difference between *.pro and *.pri configuration files for qmake? What should go into a *.pro file and what should go into a *.pri file?
Roman Byshko
  • 7,565
  • 5
  • 32
  • 54
68
votes
6 answers

cmake not working, could not exec qmake

I am using Ubuntu 14.04. I'm trying to install a program which requires cmake. When I run cmake src/ I get: qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory What am I doing wrong?
Alexandre Holden Daly
  • 6,714
  • 5
  • 20
  • 35
66
votes
2 answers

How to use QMake's subdirs template?

I'm starting to learn Qt. I'm moving from the Visual Studio world and I am looking for a way to organize my project's structure using QMake. I've found the 'subdirs' template but I have quite a hard time understanding it. My project structure…
zarzych
  • 971
  • 1
  • 11
  • 18
58
votes
6 answers

Add a define to qmake WITH a value?

How do I add a define with qmake WITH a value: For example, this does not work (as I expected) in my .pro file: DEFINES += WINVER 0x0500 nor DEFINES += "WINVER 0x0500" How do I define WINVER as 0x0500 before anything starts compiling so it's…
Jake Petroules
  • 21,796
  • 34
  • 136
  • 218
56
votes
2 answers

QMake - How to add and use a variable into the .pro file

I have a qmake file generated by Qt creator. I am modifying it but I do not manage to understand how to create a variable. For example, I want to declare the library MYPATH as I did here: MYPATH = /lib/aaa/bbb unix:!macx:!symbian: LIBS +=…
Cristas
  • 680
  • 2
  • 8
  • 11
56
votes
5 answers

C++ Qt - How to add "-std=c++11" to the makefile which is generated by qmake?

I'm developing a program in Qt. Its makefile is generated automatically from the .pro file. I need to use some code which need the -std=c++11 flag to be set up for g++. Where in .pro should I add this flag? (changing only the Makefile won't work…
Natalia Zoń
  • 921
  • 2
  • 12
  • 20
56
votes
6 answers

Why does Qt use its own make tool, qmake?

I just started using Qt and noticed that it uses its own make tool, qmake. Why does Qt use its own make tool? Is there something special that prevents it from using a standard make tool? Does qmake call the GCC C++ compiler?
Trevor Boyd Smith
  • 15,512
  • 24
  • 110
  • 159
54
votes
20 answers

Undefined reference to vtable. Trying to compile a Qt project

I'm using Code::Blocks 8.02 and the mingw 5.1.6 compiler. I'm getting this error when I compile my Qt project: C:\Documents and Settings\The Fuzz\Desktop\GUI\App_interface.cpp|33|undefined reference to `vtable for AddressBook' File…
TheFuzz
  • 2,487
  • 5
  • 27
  • 46
51
votes
4 answers

Qt compiler warning: overriding commands for target / ignoring old commands for target

When I'm compiling my Qt project for Windows I receive these 2 warnings: Makefile.Debug:109: warning: overriding commands for target `debug/moc_mainwindow.cpp' Makefile.Debug:106: warning: ignoring old commands for target…
sashoalm
  • 63,456
  • 96
  • 348
  • 677
51
votes
3 answers

Unknown module(s) in QT: svg

Added QT += svg and I tried just QT += svg and greaterThan(QT_MAJOR_VERSION, 4): QT += svg to the .pro solution file and ran qmake from inside the QtCreator and got this error: error: Unknown module(s) in QT: svg Any ideas?
user3191398
50
votes
9 answers

QMake - how to copy a file to the output

How can I copy a file from my project to the output directory with qmake? I'm compiling on Linux but in the future I'll compile it on Mac and Windows.
Raphael
  • 7,388
  • 12
  • 55
  • 81
50
votes
8 answers

How to detect target architecture using CMake?

I've done a lot of research and been unable to find an answer to this... how can I reliably find the target architecture I'm compiling for, using CMake? Basically, the equivalent to QMAKE_TARGET.arch in qmake. Most sources seem to suggest…
Jake Petroules
  • 21,796
  • 34
  • 136
  • 218
1
2 3
99 100