Results 1 to 3 of 3

Thread: qmake' s CONFIG variable' s oddity, you will hardly believe it.

  1. #1
    Join Date
    Feb 2012
    Posts
    4
    Platforms
    Unix/X11 Windows

    Default qmake' s CONFIG variable' s oddity, you will hardly believe it.

    Platforms: Win7 x64, Linux x64 (Fedora 15)

    OK, I am a newcomer to Qt but there are things which simply do not make sense:

    Under Linux (standard dynamic Qt installation):

    With the following project file:

    CONFIG = qt
    TEMPLATE = app
    HEADERS = Qt_Test.h
    SOURCES = Qt_Test.cpp

    My test program runs fine.

    With this one:

    CONFIG += qt
    TEMPLATE = app
    HEADERS = Qt_Test.h
    SOURCES = Qt_Test.cpp

    It crashes (std::bad_alloc exception or general protection fault)

    With this one:

    CONFIG = qt
    CONFIG += debug
    TEMPLATE = app
    HEADERS = Qt_Test.h
    SOURCES = Qt_Test.cpp

    or this one:

    CONFIG = qt
    CONFIG += release
    TEMPLATE = app
    HEADERS = Qt_Test.h
    SOURCES = Qt_Test.cpp

    or this one:

    CONFIG = qt
    CONFIG += debug_and_release
    TEMPLATE = app
    HEADERS = Qt_Test.h
    SOURCES = Qt_Test.cpp

    it also crashes.

    Now, under Windows (static Qt build from source) if I try what works under Linux, namely the first project file:

    CONFIG = qt
    TEMPLATE = app
    HEADERS = Qt_Test.h
    SOURCES = Qt_Test.cpp

    The linker signals about one hundred unresolved externals.

    It will accept this :

    CONFIG += qt
    TEMPLATE = app
    HEADERS = Qt_Test.h
    SOURCES = Qt_Test.cpp

    ...but the program will crash.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: qmake' s CONFIG variable' s oddity, you will hardly believe it.

    The CONFIG variable contains a bunch of stuff by default, which is why all the examples in the docs are always:
    Qt Code:
    1. CONFIG += whatever
    To copy to clipboard, switch view to plain text mode 

    The crashing of your program is impossible to diagnose because you failed to provide it.

  3. #3
    Join Date
    Nov 2010
    Posts
    315
    Thanked 53 Times in 51 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qmake' s CONFIG variable' s oddity, you will hardly believe it.

    For testing, pro file should look like this (Qt Creator generates that):
    QT += testlib
    QT -= gui
    TARGET = tst_sometest
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += tst_funytest.cpp
    DEFINES += SRCDIR=\\\"$$PWD/\\\"
    In general CONFIG contains files (*.prf) names (without extensions) located at <qt location>/mkspecs/features/ . Content of those files is "included" to the project.

Similar Threads

  1. qmake | .pro and -config
    By migel in forum Newbie
    Replies: 2
    Last Post: 4th February 2012, 21:50
  2. QMAKE custom DEFINES & CONFIG
    By sheeeng in forum Qt Programming
    Replies: 16
    Last Post: 12th January 2012, 16:04
  3. Replies: 2
    Last Post: 7th October 2010, 02:05
  4. qmake and CONFIG copy_dir_files
    By Vanir in forum Qt Programming
    Replies: 0
    Last Post: 25th February 2008, 14:56
  5. basic problem of config qmake
    By Shuchi Agrawal in forum Qt Tools
    Replies: 10
    Last Post: 10th January 2007, 09:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.