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. macOS + qt5.12.5 + cmake: debug compiled program cannot run,objc[6076]: Class Q** is implemented in both

macOS + qt5.12.5 + cmake: debug compiled program cannot run,objc[6076]: Class Q** is implemented in both

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 2.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.
  • firecatF Offline
    firecatF Offline
    firecat
    wrote on last edited by
    #1

    My development environment is: macOS Catalina + qt5.12.5 + cmake 3.16.5.
    My project's cmakelists.txt is :

    cmake_minimum_required(VERSION 3.5)
    
    project(untitled LANGUAGES CXX)
    
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTORCC ON)
    
    set(CMAKE_CXX_STANDARD 11)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    find_package(Qt5 COMPONENTS Widgets REQUIRED)
    
    add_executable(untitled
      main.cpp
      mainwindow.cpp
      mainwindow.h
      mainwindow.ui
    )
    
    target_link_libraries(untitled PRIVATE Qt5::Widgets)
    

    I use release to compile and run the executable program, but debug compilation does not work, an error will be reported:

    22:58:37: Starting /Users/liq/Documents/myproj/qt-hmi/build-untitled-Desktop_Qt_5_12_5_clang_64bit-Debug/untitled ...
    objc[6076]: Class QMacAutoReleasePoolTracker is implemented in both /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x105585200) and /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x10489ade8). One of the two will be used. Which one is undefined.
    objc[6076]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x105585278) and /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x10489ae60). One of the two will be used. Which one is undefined.
    objc[6076]: Class KeyValueObserver is implemented in both /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x1055852a0) and /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x10489ae88). One of the two will be used. Which one is undefined.
    objc[6076]: Class RunLoopModeTracker is implemented in both /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x1055852f0) and /Users/liq/Qt5.12.5/5.12.5/clang_64/lib/QtCore.framework/Versions/5/QtCore_debug (0x10489aed8). One of the two will be used. Which one is undefined.
    22:58:37: The process was ended forcefully.
    

    How to solve this problem?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Looks like you have several versions of Qt installed. Do you have dependencies built with that other version ?

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

      firecatF 2 Replies Last reply
      0
      • SGaistS SGaist

        Hi,

        Looks like you have several versions of Qt installed. Do you have dependencies built with that other version ?

        firecatF Offline
        firecatF Offline
        firecat
        wrote on last edited by
        #3

        @SGaist I have qt4.8.7 and Qt5.12.5. My qmake is normal, only cmake debug has problems. what should I do?

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Looks like you have several versions of Qt installed. Do you have dependencies built with that other version ?

          firecatF Offline
          firecatF Offline
          firecat
          wrote on last edited by
          #4

          @SGaist said in macOS + qt5.12.5 + cmake: debug compiled program cannot run,objc[6076]: Class Q** is implemented in both:

          Hi,

          Looks like you have several versions of Qt installed. Do you have dependencies built with that other version ?

          I solved this problem. Just delete the configuration file of QtCreator. The path of the file is:
          /Users/<username>/.config/QtProject/

          Restart QtCreator and everything works!

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Glad you found out and thanks for sharing !

            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

            • Login

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