Project Error: library libatomic is not defined



  • I'm attempting to compile a qt app on KDE Neon and I keep getting the following error.

    Project Error: library libatomic is not defined

    I assumed it was a missing dev pkg but I've installed every qt dev and libatomic pkg I could find in the repos. I still get the error.

    My project contains a gui and cli app in separate subfolders.

    main.pro
      cli folder
        cli.pro
      gui folder
        gui.pro
    

    My cli.pro contains "CONFIG += c++11" and I use unistd.h in the main.cpp file. I use "QT += core gui sql network widgets" in the gui.pro file. As soon as I run "qmake -recursive" it throws the libatomic error. I've tried grepping my source files and system headers for libatomic and I can't find where this is being included. Is this a missing package? What do I need to install to fix this?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What compiler are you using ?



  • This is my qmake.stash file.

    QMAKE_CXX.INCDIRS = \
        /usr/include/c++/7 \
        /usr/include/x86_64-linux-gnu/c++/7 \
        /usr/include/c++/7/backward \
        /usr/lib/gcc/x86_64-linux-gnu/7/include \
        /usr/local/include \
        /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed \
        /usr/include/x86_64-linux-gnu \
        /usr/include
    QMAKE_CXX.LIBDIRS = \
        /usr/lib/gcc/x86_64-linux-gnu/7 \
        /usr/lib/x86_64-linux-gnu \
        /usr/lib \
        /lib/x86_64-linux-gnu \
        /lib
    QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
    QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 7
    QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3
    QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
    QMAKE_CXX.COMPILER_MACROS = \
        QT_COMPILER_STDCXX \
        QMAKE_GCC_MAJOR_VERSION \
        QMAKE_GCC_MINOR_VERSION \
        QMAKE_GCC_PATCH_VERSION
    
    

  • Lifetime Qt Champion

    Can you show your .pro files content ?



  • I have the same issue. I've tried creating a new QT Project (a QT Widget Application), and I still have the issue ; tried with both GCC and clang.

    The issue appeared on my system when I upgraded (I'm on debian sid) libatomic1 from version 8.2.0-17 to 8.2.0-19, and qt5-qmake from version 5.11.3+dfsg-2 to 5.11.3+dfsg-4. I upgraded both of them at the same time, so I don't know which one is the culprit.

    Here is the .pro for the new project (didn't change anything from QTCreator's generated file) :

    #-------------------------------------------------
    #
    # Project created by QtCreator 2019-02-09T21:42:29
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = bugqt
    TEMPLATE = app
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as 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 from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    

    Here's the .qmake.stash for clang :

    QMAKE_CXX.INCDIRS = \
        /usr/include/c++/8 \
        /usr/include/x86_64-linux-gnu/c++/8 \
        /usr/include/c++/8/backward \
        /usr/include/clang/7.0.1/include \
        /usr/local/include \
        /usr/include/x86_64-linux-gnu \
        /usr/include
    QMAKE_CXX.LIBDIRS = \
        /usr/lib/llvm-7/lib/clang/7.0.1 \
        /usr/lib/gcc/x86_64-linux-gnu/8 \
        /usr/lib/x86_64-linux-gnu \
        /usr/lib64 \
        /lib/x86_64-linux-gnu \
        /lib64 \
        /usr/lib \
        /usr/lib/llvm-7/lib \
        /lib
    QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
    QMAKE_CXX.QMAKE_CLANG_MAJOR_VERSION = 7
    QMAKE_CXX.QMAKE_CLANG_MINOR_VERSION = 0
    QMAKE_CXX.QMAKE_CLANG_PATCH_VERSION = 1
    QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 4
    QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2
    QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 1
    QMAKE_CXX.COMPILER_MACROS = \
        QT_COMPILER_STDCXX \
        QMAKE_CLANG_MAJOR_VERSION \
        QMAKE_CLANG_MINOR_VERSION \
        QMAKE_CLANG_PATCH_VERSION \
        QMAKE_GCC_MAJOR_VERSION \
        QMAKE_GCC_MINOR_VERSION \
        QMAKE_GCC_PATCH_VERSION
    
    

    And the .qmake.stash for gcc :

    QMAKE_CXX.INCDIRS = \
        /usr/include/c++/8 \
        /usr/include/x86_64-linux-gnu/c++/8 \
        /usr/include/c++/8/backward \
        /usr/lib/gcc/x86_64-linux-gnu/8/include \
        /usr/local/include \
        /usr/lib/gcc/x86_64-linux-gnu/8/include-fixed \
        /usr/include/x86_64-linux-gnu \
        /usr/include
    QMAKE_CXX.LIBDIRS = \
        /usr/lib/gcc/x86_64-linux-gnu/8 \
        /usr/lib/x86_64-linux-gnu \
        /usr/lib \
        /lib/x86_64-linux-gnu \
        /lib
    QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
    QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 8
    QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2
    QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
    QMAKE_CXX.COMPILER_MACROS = \
        QT_COMPILER_STDCXX \
        QMAKE_GCC_MAJOR_VERSION \
        QMAKE_GCC_MINOR_VERSION \
        QMAKE_GCC_PATCH_VERSION
    
    


  • I can confirm that a default qtcreator generated .pro file results in the same error as Glorf posted above. I've tried to compile other applications and I can't get past the libatomic error. It occurs regardless of the contents of the .pro files.



  • The bug is in Debian's packaging. We have just been informed of it (I'm part of Debian's Qt/KDE team) and the fix is in progress.

    Our most sincere apologies for it.

    @IcodeO In the meantime you can either switch back to testing's version or install qtbase5-private-dev as a workaround. If you are doing Debian packaging please do not add this dependency, the bug will be fixed today.



  • Thanks, this fixed it for me. I'm curious, what's exactly in qtbase5-private-dev that fixes it ? It looks like it's internal headers/lib of Qt


  • Lifetime Qt Champion

    @Lisandro-D-N-Perez-Meyer Hi and welcome to devnet !

    Any link to where the status of this bug can be tracked ?



  • Any link to where the status of this bug can be tracked ?

    Here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921930. The bug seems to be fixed in Debian buster, sid and experimental. But it is not fixed in KDE neon yet.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.