qmake

qmake can't evaluate a proper variable

喜你入骨 提交于 2019-12-10 20:19:02
问题 I'd like to share my build version in the app but I can't get that thing to work... this is a part of my .pro file... LITERAL_HASH = "foo"; BUILD = "$${LITERAL_HASH}{\"sexy Installer\"},(0x12345678),1,0,3"; DEPLOYMENT.installer_header = $$(BUILD); message(bar .$$(BUILD).) and when I run qmake from Qt menu the output is: Project MESSAGE: bar .. I'm doing everything according to the docs and still that variable seems to be empty... 回答1: Use $${BUILD} instead of $$(BUILD) . The $() operator

qmake does not add widgets

你说的曾经没有我的故事 提交于 2019-12-10 20:17:23
问题 i have a simple program. my program is: #include <QApplication> #include <QLabel> int main(int argc, char *argv[]) { int rc ; QApplication app(argc, argv); QLabel *label = new QLabel("Hello Qt!"); label->show(); rc = app.exec(); return(rc) ; } i want to compile and build this code in command line. i have installed qt and mingw. first my command is: qmake -project then i give this command. qmake then qmake creates .pro file which is: TEMPLATE = app TARGET = HELLO INCLUDEPATH += . # Input

Adding -std=gnu++11 compiler flag to QMake

一个人想着一个人 提交于 2019-12-10 17:26:58
问题 I am compiling qt5.7 on windows with mingw32 and g++.4.9.3. While executing the configure.bat, I get this error : C:\qt-everywhere-opensource-src-5.7.0\configure.bat -prefix C:\Qt-5.7 -skip qttools -skip qtwebchannel -skip qtwebengine -skip qtcharts -skip qtdatavis3d -platform win32-g++ C:\qt-everywhere-opensource-src-5.7.0\qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QByteArray QMakeEvaluator::getCommandOutput(const QString&) const': C:\qt-everywhere-opensource-src-5.7.0

Adding QMAKE_CXXFLAGS += -std=c++11 to .pro file in qt not working(on linux 12.04)

一曲冷凌霜 提交于 2019-12-10 14:59:23
问题 Compiler output: [main.o] Error 1 cc1plus: error: unrecognized command line option '-std=c++11' 回答1: The solution is to update your ancient gcc version on the system. In fact, I am quite surprised that you have such an old version on your 12.04 Ubuntu variant. It should have 4.6.3 by deault. What you could try is c++0x instead of c++11 and see if that makes it work. You could also fire up the gcc manual by issuing man gcc and look for the precise option. Also, while we are it, you could

qmake .pro file could not be parsed

蹲街弑〆低调 提交于 2019-12-10 14:49:00
问题 I'm running OS X Mavericks and trying to convert a Qt4 application to Qt5. I've also never compiled the application on this machine before. I have Qt 5.1.* installed on this machine, which parses the file just fine. As soon as I switch over to my Qt 5.2.0 kit and look at the run settings, underneath my "Run configuration" there's a warning: "The .pro file '.pro' could not be parsed.". I've looked at other solutions on SO and the qt-project website -- none of which have helped. My Qt 5.2.0 kit

Define a string in qmake command line

吃可爱长大的小学妹 提交于 2019-12-10 14:07:24
问题 I need to pass a string as a definition to my source code which is a base64 encoded string (so may contain / and " ). I'm using qmake and g++. I've tried so many combinations, but neither works: qmake DEFINES+=SERIAL=\\\"f9a/z\\\" qmake DEFINES+=SERIAL=\"f9a/z\" qmake DEFINES+="SERIAL=\\"f9a/z\\\"" G++ should get the serial like this: g++ -DSERIAL=\"f9a/z\" 回答1: In bash: qmake DEFINES+=SERIAL=\\\\\\\"\"f9a/z\\\\\\\"\" In a scripting language: "DEFINES+=SERIAL=\\\\\\\"" + str + "\\\\\\\"" 来源:

qmake with INCLUDEPATH ignores dependencies

对着背影说爱祢 提交于 2019-12-10 13:54:00
问题 I use qmake to build a project. The project contains several static libs and a executable. The executable links to the static libraries and therefore has the path of the library added to the INCLUDEPATH variable. When I change something in the header files of the executable everything is rebuild as expected. When changing a header file of the library it just rebuilds the library and relinks the executable. Source files in the executable that include header files from the library are not

qmake processes my pro-file three times instead of one

混江龙づ霸主 提交于 2019-12-10 13:05:51
问题 This is entire pro file: message("This message should appeare only once!!!") CONFIG += qt SOURCES += src/main.cpp I invoke qmake in the following way: set QMAKESPEC=win32-msvc2008 set QTDIR=c:\Qt\4.8.4_vs2008\ call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 call "%QTDIR%\bin\qmake.exe" -tp vc Server.pro And I get following output: Setting environment for using Microsoft Visual Studio 2008 x86 tools. Project MESSAGE: This message should be appeared only once!!!

How to specify auto-generated resource files to Qmake?

本秂侑毒 提交于 2019-12-10 12:52:12
问题 I have a Qt project with a german translation, Translation_de.ts , which is automatically compiled into Translation_de.qm via Qmake: TRANSLATIONS += Translation_de.ts ... QMAKE_EXTRA_COMPILERS += lrelease lrelease.input = TRANSLATIONS lrelease.output = ${QMAKE_FILE_BASE}.qm lrelease.commands = $$[QT_INSTALL_BINS]/lrelease ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_BASE}.qm lrelease.CONFIG += no_link target_predeps The generated Translation_de.qm is then compiled into the final application as a

Qt and QMake build dir

不羁的心 提交于 2019-12-10 08:17:32
问题 I would like to build qt and qt application out of the source tree. Do you know how to set from the command line the .obj directory both with configure and qmake? 回答1: If I understand question correctly you should set OBJECTS_DIR variable in *.pro file for any directory you want. If you don't want to change *.pro file try qmake "OBJECTS_DIR=some_dir" *.pro 来源: https://stackoverflow.com/questions/1741877/qt-and-qmake-build-dir