Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Project Error: library libatomic is not defined
QtWS25 Last Chance

Project Error: library libatomic is not defined

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 5 Posters 4.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IcodeO
    wrote on 9 Feb 2019, 12:28 last edited by
    #1

    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?

    1 Reply Last reply
    2
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Feb 2019, 16:30 last edited by SGaist 2 Sept 2019, 16:31
      #2

      Hi and welcome to devnet,

      What compiler are you using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • I Offline
        I Offline
        IcodeO
        wrote on 9 Feb 2019, 17:47 last edited by
        #3

        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
        
        
        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 9 Feb 2019, 22:16 last edited by
          #4

          Can you show your .pro files content ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Glorf
            wrote on 9 Feb 2019, 23:06 last edited by
            #5

            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
            
            
            1 Reply Last reply
            0
            • I Offline
              I Offline
              IcodeO
              wrote on 10 Feb 2019, 00:12 last edited by
              #6

              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.

              1 Reply Last reply
              0
              • L Offline
                L Offline
                Lisandro D. N. Perez Meyer
                wrote on 10 Feb 2019, 13:54 last edited by Lisandro D. N. Perez Meyer 2 Oct 2019, 13:57
                #7

                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.

                1 Reply Last reply
                8
                • G Offline
                  G Offline
                  Glorf
                  wrote on 10 Feb 2019, 17:29 last edited by
                  #8

                  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

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 9 Mar 2019, 22:21 last edited by
                    #9

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

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

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    I 1 Reply Last reply 26 Mar 2019, 07:41
                    0
                    • S SGaist
                      9 Mar 2019, 22:21

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

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

                      I Offline
                      I Offline
                      Igor Kushnir
                      wrote on 26 Mar 2019, 07:41 last edited by
                      #10

                      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.

                      1 Reply Last reply
                      2

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved