Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Can someone tell my how I can find the QT include headers or write an app to do it?



  • This is confusing when the examples I have found are for finding more than one file. I just want to know how to find the directory to the QT headers. I know I should confine my search to a compiler path within my QT directory.



  • If you are doing this to compile a project then both qmake and cmake should look after this for you.

    To find out where various parts of a Qt installation are located execute:

    qmake -query
    

    using the qmake from the version of Qt you want to interrogate. Example output on my Ubuntu system:

    QT_SYSROOT:
    QT_INSTALL_PREFIX:/usr
    QT_INSTALL_ARCHDATA:/usr/lib/x86_64-linux-gnu/qt5
    QT_INSTALL_DATA:/usr/share/qt5
    QT_INSTALL_DOCS:/usr/share/qt5/doc
    QT_INSTALL_HEADERS:/usr/include/x86_64-linux-gnu/qt5
    QT_INSTALL_LIBS:/usr/lib/x86_64-linux-gnu
    QT_INSTALL_LIBEXECS:/usr/lib/x86_64-linux-gnu/qt5/libexec
    QT_INSTALL_BINS:/usr/lib/qt5/bin
    QT_INSTALL_TESTS:/usr/tests
    QT_INSTALL_PLUGINS:/usr/lib/x86_64-linux-gnu/qt5/plugins
    QT_INSTALL_IMPORTS:/usr/lib/x86_64-linux-gnu/qt5/imports
    QT_INSTALL_QML:/usr/lib/x86_64-linux-gnu/qt5/qml
    QT_INSTALL_TRANSLATIONS:/usr/share/qt5/translations
    QT_INSTALL_CONFIGURATION:/etc/xdg
    QT_INSTALL_EXAMPLES:/usr/lib/x86_64-linux-gnu/qt5/examples
    QT_INSTALL_DEMOS:/usr/lib/x86_64-linux-gnu/qt5/examples
    QT_HOST_PREFIX:/usr
    QT_HOST_DATA:/usr/lib/x86_64-linux-gnu/qt5
    QT_HOST_BINS:/usr/lib/qt5/bin
    QT_HOST_LIBS:/usr/lib/x86_64-linux-gnu
    QMAKE_SPEC:linux-g++
    QMAKE_XSPEC:linux-g++
    QMAKE_VERSION:3.1
    QT_VERSION:5.12.8
    

Log in to reply