Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt 6.8 Duplicate symbol: qInitResources
Forum Updated to NodeBB v4.3 + New Features

Qt 6.8 Duplicate symbol: qInitResources

Scheduled Pinned Locked Moved Solved Qt 6
11 Posts 3 Posters 1.1k 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #2

    See https://bugreports.qt.io/browse/QTBUG-130056

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    1 Reply Last reply
    1
    • P Parvathy2020

      Hi,

      My Qt application has seperate cmake files for windows build & android build.

      Recently , I have updated to 6.8, and after that android build fails with below errors :

      ld.lld: error: duplicate symbol: qInitResources_resources()

      defined at qrc_resources.cpp:981 (amc_v4_android/.qt/rcc/qrc_resources.cpp:981)
      CMakeFiles/amc_v4_android.dir/amc_v4_android/.qt/rcc/qrc_resources.cpp.o:(qInitResources_resources())
      defined at qrc_resources.cpp:981 (amc_v4_android_autogen/MU24V53QS3/qrc_resources.cpp:981)
      CMakeFiles/amc_v4_android.dir/amc_v4_android_autogen/MU24V53QS3/qrc_resources.cpp.o:(.text._Z24qInitResources_resourcesv+0x0)

      ld.lld: error: duplicate symbol: qCleanupResources_resources()

      defined at qrc_resources.cpp:990 (amc_v4_android/.qt/rcc/qrc_resources.cpp:990)
      CMakeFiles/amc_v4_android.dir/amc_v4_android/.qt/rcc/qrc_resources.cpp.o:(qCleanupResources_resources())
      defined at qrc_resources.cpp:990 (amc_v4_android_autogen/MU24V53QS3/qrc_resources.cpp:990)
      CMakeFiles/amc_v4_android.dir/amc_v4_android_autogen/MU24V53QS3/qrc_resources.cpp.o:(.text._Z27qCleanupResources_resourcesv+0x0)
      clang++: error: linker command failed with exit code 1 (use -v to see invocation)
      ninja: build stopped: subcommand failed.

      My cmake file :
      *cmake_minimum_required(VERSION 3.20)

      qt_add_resources(amc_v4_android "resources"
      PREFIX "/"
      FILES
      ../amc/qml/amc.qrc
      ../localizations/localizations.qrc
      ../packages/servicetools-components/shared/mobile.qrc
      ../packages/servicetools-components/shared/assets.qrc
      ../packages/servicetools-components/ui-strings/ui-strings.qrc
      ../packages/kmt-protocols/javascript/auth_v2.qrc
      ../packages/kmt-protocols/javascript/auth_v4.qrc
      ../packages/kmt-protocols/javascript/avnp.qrc
      ../packages/kmt-protocols/javascript/dmif.qrc
      ../packages/kmt-protocols/javascript/d200st.qrc
      ../packages/kmt-protocols/javascript/failif.qrc
      ../packages/kmt-protocols/javascript/mcds.qrc
      ../packages/kmt-protocols/javascript/scc.qrc
      ../packages/kmt-protocols/javascript/servicetool.qrc
      ../packages/kmt-protocols/javascript/spade.qrc
      ../packages/kmt-protocols/javascript/stif.qrc
      ../packages/kmt-protocols/javascript/est.qrc
      ../base/base.qrc
      ../SoftwareLicenses/softwarelicenses_android.qrc
      )

      target_include_directories(amc_v4_android PUBLIC
      ${PACKAGES_INCLUDES}
      ${BASE_CODE_DIR}
      ....
      )

      target_link_libraries(amc_v4_android PUBLIC
      ${PACKAGES_LIBRARIES}
      product
      base
      suite
      door-tool
      group-tool
      legacy-group-tool
      lift-tool
      lio-tool
      Qt::Core
      Qt::Gui
      Qt::Qml
      Qt::Quick
      Qt::Svg
      Qt::Xml
      )

      Gather the required libraries

      list(APPEND android_extra_libs
      ${PROJECT_SOURCE_DIR}/packages/openssl/3.0.0/${ANDROID_ABI}/libcrypto_3.so
      ${PROJECT_SOURCE_DIR}/packages/openssl/3.0.0/${ANDROID_ABI}/libssl_3.so
      )

      Get version string from version header

      file(STRINGS ${PROJECT_SOURCE_DIR}/version/version.h VERSION_DEFINITION REGEX "VERSION_STRING")
      string(REGEX MATCH "[0-9\.]+" AMC_VERSION "${VERSION_DEFINITION}")

      Tell Qt6 to use the correct source, libraries, sdk etc.

      set_target_properties(amc_v4_android PROPERTIES
      QT_ANDROID_PACKAGE_SOURCE_DIR "${PROJECT_SOURCE_DIR}/android"
      QT_ANDROID_EXTRA_LIBS "${android_extra_libs}"
      QT_ANDROID_MIN_SDK_VERSION 31
      QT_ANDROID_TARGET_SDK_VERSION 33
      QT_ANDROID_VERSION_NAME "${AMC_VERSION}"
      )*

      Please provide support to resolve the issue.

      P Offline
      P Offline
      Parvathy2020
      wrote on last edited by
      #3

      @Parvathy2020 Thanks @Christian-Ehrlicher Thanks for the information. The bug report page about the same issue that I face.
      So this was a known issue /bug & it is mentioned in the page that fix for the issue is already available with Qt 6.8.

      But I am using latest Qt 6.8 which I installed 3 days back. But still I get the error.

      Also as mentioned in the page, I have removed the set(CMAKE_AUTOUIC ON) , set(CMAKE_AUTOMOC ON) and set(CMAKE_AUTORCC ON) from my code.

      Is there any other changes to be made to resolve the issue.

      Thanks in advance.

      Christian EhrlicherC 1 Reply Last reply
      0
      • P Parvathy2020

        @Parvathy2020 Thanks @Christian-Ehrlicher Thanks for the information. The bug report page about the same issue that I face.
        So this was a known issue /bug & it is mentioned in the page that fix for the issue is already available with Qt 6.8.

        But I am using latest Qt 6.8 which I installed 3 days back. But still I get the error.

        Also as mentioned in the page, I have removed the set(CMAKE_AUTOUIC ON) , set(CMAKE_AUTOMOC ON) and set(CMAKE_AUTORCC ON) from my code.

        Is there any other changes to be made to resolve the issue.

        Thanks in advance.

        Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @Parvathy2020 said in Qt 6.8 Duplicate symbol: qInitResources:

        But I am using latest Qt 6.8 which I installed 3 days back.

        How? Did you compile from source? Otherwise you're using Qt6.8.0 which does not contain the fix.
        But you can apply them manually - it's only six additional lines in a cmake script.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        P 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @Parvathy2020 said in Qt 6.8 Duplicate symbol: qInitResources:

          But I am using latest Qt 6.8 which I installed 3 days back.

          How? Did you compile from source? Otherwise you're using Qt6.8.0 which does not contain the fix.
          But you can apply them manually - it's only six additional lines in a cmake script.

          P Offline
          P Offline
          Parvathy2020
          wrote on last edited by
          #5

          @Christian-Ehrlicher Oh yes, my bad , I am using 6.8.0. So the fix is not available with that.
          Got it now.

          Is this the change that need to be added in src/corelib/Qt6CoreMacros.cmake ?
          d41ccb4f-8fbd-4f45-9e38-a5150eb7506e-image.png

          Any change required to be added in my application cmake file ?

          Christian EhrlicherC 1 Reply Last reply
          0
          • P Parvathy2020

            @Christian-Ehrlicher Oh yes, my bad , I am using 6.8.0. So the fix is not available with that.
            Got it now.

            Is this the change that need to be added in src/corelib/Qt6CoreMacros.cmake ?
            d41ccb4f-8fbd-4f45-9e38-a5150eb7506e-image.png

            Any change required to be added in my application cmake file ?

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @Parvathy2020 said in Qt 6.8 Duplicate symbol: qInitResources:

            Any change required to be added in my application cmake file ?

            Why - the bug report clearly states that the fix from gerrit fixes the problem.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            P 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @Parvathy2020 said in Qt 6.8 Duplicate symbol: qInitResources:

              Any change required to be added in my application cmake file ?

              Why - the bug report clearly states that the fix from gerrit fixes the problem.

              P Offline
              P Offline
              Parvathy2020
              wrote on last edited by
              #7

              Thanks @Christian-Ehrlicher ! The error got solved now. I have updated Qt6CoreMacros.cmake file with the change . Thanks !

              When will fix for this issue will be available with Qt 6.8.0 ?

              jsulmJ 1 Reply Last reply
              0
              • P Parvathy2020

                Thanks @Christian-Ehrlicher ! The error got solved now. I have updated Qt6CoreMacros.cmake file with the change . Thanks !

                When will fix for this issue will be available with Qt 6.8.0 ?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @Parvathy2020 Just look at "Fix Version/s:" in the bug ticket

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                P 1 Reply Last reply
                0
                • P Parvathy2020 has marked this topic as solved on
                • jsulmJ jsulm

                  @Parvathy2020 Just look at "Fix Version/s:" in the bug ticket

                  P Offline
                  P Offline
                  Parvathy2020
                  wrote on last edited by
                  #9

                  @jsulm Yes, from the fix versions , it is seen that fix available in 6.5.8, 6.8.1, 6.9.0 FF .

                  But I have installed 6.8.0 LTS version . Will the fix for this will be available to 6.8.0 any time later or is it required to upgrade to 6.8.1. What is the suggested solution ?

                  Christian EhrlicherC jsulmJ 2 Replies Last reply
                  0
                  • P Parvathy2020

                    @jsulm Yes, from the fix versions , it is seen that fix available in 6.5.8, 6.8.1, 6.9.0 FF .

                    But I have installed 6.8.0 LTS version . Will the fix for this will be available to 6.8.0 any time later or is it required to upgrade to 6.8.1. What is the suggested solution ?

                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @Parvathy2020 said in Qt 6.8 Duplicate symbol: qInitResources:

                    ill the fix for this will be available to 6.8.0 any time later or is it required to upgrade to 6.8.1.

                    As you already wrote it's available in 6.8.1 so how should it magically go into the already released 6.8.0 version then?

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    0
                    • P Parvathy2020

                      @jsulm Yes, from the fix versions , it is seen that fix available in 6.5.8, 6.8.1, 6.9.0 FF .

                      But I have installed 6.8.0 LTS version . Will the fix for this will be available to 6.8.0 any time later or is it required to upgrade to 6.8.1. What is the suggested solution ?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      @Parvathy2020 said in Qt 6.8 Duplicate symbol: qInitResources:

                      But I have installed 6.8.0 LTS version

                      If 6.8 is a LTS version then also all 6.8.x versions are LTS and you should anyway upgrade to these versions to get all the bug fixes.

                      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