对于Mac 上的控制台程序,如果在工程文件中添加一行 CONFIG -= app_bundle ,就可以阻止创建一个 app bundle,它会将可执行文件 放入 I 一个子目录下。这样做还允许用户与标准 I/O 的交互。然后,就可以使用命令行 qmake-spec macx-g++ 创建一个 Makefile。这样,命令 make 就只会为应用创建一个可执行文件。
注意:添加opengl到QT变量里面,等价于往CONFIG变量里面添加。 所以对于Qt应用程序来说,没必要同时往QT变量和CONFIG变量里面添加opengl选项。 3.4 关于 CONFIG(debug, debug|release)语法 CONFIG变量可以同时定义 debug 和 release,但只有一个处于active(当两个互斥的值都出现时,最后设置的处于active状态) 什么意思?怎么理...
thread使能Thread支持。当CONFIG包含qt(默认设置)时,将使能此功能。 c99使能C99支持。 如果编译器不支持C99或无法选择C标准,则此选项无效。 默认情况下,使用编译器默认值。 c11使能C11支持。 如果编译器不支持C11或无法选择C标准,则此选项无效。 默认情况下,使用编译器默认值。
CONFIG += console CONFIG -= app_bundle SOURCES += main.cpp 1.2 main.cpp #include <QApplication> #include <QDebug> #include <QThread> #include <QString> #include <QtConcurrent> void func(QString name) { qDebug() << "Hello" << name << "from" << QThread::currentThread(); } int...
CONFIG -= app_bundle # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away ...
A Qt command line application on Mac OS X works similar to a command line application on Unix and Windows. You probably don't want to run it in a bundle: Add this to your application's .pro: CONFIG-=app_bundle This will tellqmakenot to put the executable inside a bundle. Please refe...
CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the ...
lib_bundle 只适用于Mac OS X编译,指库被放到框架中 pro文件的基本语法 pro文件中的条目的语法通常具有以下形式: variable =values #注释 其中variable代表变量,values代表字符串列表,注释则以#开头,在行尾处结束。例如: CONFIG = qt release warn_off # 将列表["qt","release","warn_off"]赋值给CONFIG变量...
CONFIG += c++11 console CONFIG -= app_bundle # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the ...
CONFIG += console CONFIG -= app_bundle CONFIG -= qt #not good #LIBS += -L /usr/local/lib -lhiredis LIBS += "/usr/local/lib/libhiredis.a" SOURCES += main.c 说明一下,如果使用QMAKE_LFLAGS += -lhiredis,等价于LIBS += /usr/local/lib/libhiredis.so ...