Results 1 to 6 of 6

Thread: QMAKE_CXX.COMPILER_MACROS is not defined

  1. #1
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QMAKE_CXX.COMPILER_MACROS is not defined

    Hi together,

    I just wanted to work with a "Getting Started with Qt5"-book and a "Hello-World"-project but now I have some difficulties when
    using qmake in a termial / console i.e. not using Qt-Creator. So here is my source ( not really spectacular ):

    Qt Code:
    1. #include <QApplication>
    2. #include <QLabel>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7. QLabel label("Hallo Werner!");
    8. label.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    "qmake" is not found but "qmake6" is found and returns help-information.
    "qmake6 -project" returns "Variable QMAKE_CXX.COMPILER_MACROS is not defined." but a
    project-file is created.
    When I type "qmake6" again, then a Makefile is also created.

    But when I finally type "make" then I get "

    hello.cpp:1:10: fatal error: QApplication: Datei oder Verzeichnis nicht gefunden
    1 | #include <QApplication>
    | ^~~~~~~~~~~~~~

    In Qt-Create under settings->kits I get with "Desktop Qt 6.4.2 GCC 64bit" an orange warning
    sign and the warning:
    The CMAKE-Configuration has set a C-compiler although the kit has no valid toolchain.

    Anyway the QLibraries are not found.

    Op-system ist OpenSuse-Linux Leap 15.4,
    Installation is non commercial and was done using the Qt-Maintenance Tool.

    Any hint what is wrong with my installation? Under Qt4 everything worked fine.

    Best regards
    Werner

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,243
    Thanks
    303
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMAKE_CXX.COMPILER_MACROS is not defined

    What do you get when you run these from a terminal window?

    Qt Code:
    1. qmake -query QMAKE_SPEC
    2.  
    3. qmake -query QT_INSTALL_PREFIX
    To copy to clipboard, switch view to plain text mode 

    (or qmake6 if that's what your Qt version uses). If QMAKESPEC isn't set, then you have a configuration problem.

    You can set properties using qmake:

    Qt Code:
    1. qmake -set QT_INSTALL_PREFIX /path/to/top_of_qt_install
    To copy to clipboard, switch view to plain text mode 

    where "/path/to/top_of_qt_install" is the directory where the "bin", "lib", "include", etc. directories can be found for your Qt distro.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QMAKE_CXX.COMPILER_MACROS is not defined

    Dear d_stranz,

    with

    Qt Code:
    1. qmake6 -query QMAKE_SPEC
    To copy to clipboard, switch view to plain text mode 
    I get "linux-g++"

    and with

    Qt Code:
    1. qmake6 -query QT_INSTALL_PREFIX
    To copy to clipboard, switch view to plain text mode 
    I get at first "**Unknown**"

    and after

    Qt Code:
    1. qmake6 -set QT_INSTALL_PREFIX /usr/lib64/qt6
    2. qmake6 -query QT_INSTALL_PREFIX
    To copy to clipboard, switch view to plain text mode 

    I only get "/usr" but not the complete path as written above. This seems strange to me. I
    expected to see "/usr/bin64/qt6"

    Any help please?

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,243
    Thanks
    303
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMAKE_CXX.COMPILER_MACROS is not defined

    Any help please?
    I don't know. Maybe try putting /usr/lib64/qt6 in quotes?

    Qt Code:
    1. qmake6 -set QT_INSTALL_PREFIX "/usr/lib64/qt6"
    To copy to clipboard, switch view to plain text mode 

    Edit:
    I only get "/usr" but not the complete path as written above. This seems strange to me. I expected to see "/usr/bin64/qt6"
    Now wait - what is it, /usr/lib64/qt6 or /usr/bin64/qt6? If there is no Qt installation at whatever you tried, then it could fail.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Mar 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QMAKE_CXX.COMPILER_MACROS is not defined

    Quote Originally Posted by d_stranz View Post
    I don't know. Maybe try putting /usr/lib64/qt6 in quotes?

    Qt Code:
    1. qmake6 -set QT_INSTALL_PREFIX "/usr/lib64/qt6"
    To copy to clipboard, switch view to plain text mode 

    Edit:

    Now wait - what is it, /usr/lib64/qt6 or /usr/bin64/qt6? If there is no Qt installation at whatever you tried, then it could fail.

    Hi,
    meanwhile I erased QT5 and QT6 using Qt Maintenance and I also deleted all the related directories. "qmake6 -set" and "qmake6 -unset"
    didn't work. qmake -query QT_INSTALL_PREFIX always returned /usr.
    Then I reinstalled QT6 and QT5 from https://www.qt.io/download. You have the possibility to choose Qt 6.5.0, Qt 6.4.3, Qt 5.15.2
    and a few others during installation. More than one version can be selected. The version (kit) can be selected later during your development.
    As I had problems with Qt 6 I successfully tried Qt 5.15.2 (desktop).
    After the installation I found the complete installation directories under my local directory, including qmake. In order to be able to
    call qmake directly without typing the whole path I created a symbolic link under /usr/bin that points to
    /home/myname_xy/Qt/6.5.0/gcc_64/bin/qmake. "qmake -query QT_INSTALL_PREFIX" now returns /home/myname_xy/Qt/6.5.0/gcc_64.
    So I was misleaded earlier when I was trying to use the installation under the root directory. The complete installation is to be found
    under my local directory.

    "qmake -project" and "qmake" are now working in the shell as expected.
    Only "make" tells me that QApplication, QLabel and the others cannot be found.
    I have no solution for that. Do you have any idea how to fix that? Has this to do
    with the selected version/kit? In Creator everthing works fine when I select Qt 5.15.2 desktop.

    So far it is ok.

    Regards [/QUOTE]
    Last edited by Panda281; 1st May 2023 at 18:23.

  6. #6
    Join Date
    Aug 2018
    Location
    South-Africa
    Posts
    4
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QMAKE_CXX.COMPILER_MACROS is not defined

    I think Qt and all the users that have this problem are going to have it for a very long time time still.
    The newest versions of Qt still have this issue.

    Regards
    Frik Brits

Similar Threads

  1. Replies: 2
    Last Post: 8th November 2016, 05:44
  2. Replies: 6
    Last Post: 3rd December 2012, 08:26
  3. Multiply defined symbols
    By jblovloss in forum Qwt
    Replies: 0
    Last Post: 17th July 2009, 17:47
  4. Own defined Dockareas
    By jobrandt in forum Qt Programming
    Replies: 7
    Last Post: 18th July 2007, 11:48
  5. MSG not defined (winEvent)
    By December in forum Qt Programming
    Replies: 6
    Last Post: 19th February 2007, 17:24

Tags for this Thread

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.