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. Problems with translation files with Qt 6.8
Forum Update on Monday, May 27th 2025

Problems with translation files with Qt 6.8

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

    Hello, I am currently facing some issue that was not present in 6.7.3. It is related to translation files, when application links I get this error:

    duplicate symbol 'qCleanupResources_AbracaDABra_translations()' in:
        /Users/kejpi/Devel/AbracaDABra/build/Qt_6_8_0_for_macOS-Debug/gui/CMakeFiles/AbracaDABra.dir/AbracaDABra_autogen/JYUKLDW5FZ/qrc_AbracaDABra_translations.cpp.o
        /Users/kejpi/Devel/AbracaDABra/build/Qt_6_8_0_for_macOS-Debug/gui/CMakeFiles/AbracaDABra.dir/__/.qt/rcc/qrc_AbracaDABra_translations.cpp.o
    duplicate symbol 'qInitResources_AbracaDABra_translations()' in:
        /Users/kejpi/Devel/AbracaDABra/build/Qt_6_8_0_for_macOS-Debug/gui/CMakeFiles/AbracaDABra.dir/AbracaDABra_autogen/JYUKLDW5FZ/qrc_AbracaDABra_translations.cpp.o
        /Users/kejpi/Devel/AbracaDABra/build/Qt_6_8_0_for_macOS-Debug/gui/CMakeFiles/AbracaDABra.dir/__/.qt/rcc/qrc_AbracaDABra_translations.cpp.o
    

    I have this in CMakeLists.txt:

    set(TSFILES
        l10n/${TARGET}_cs.ts
        l10n/${TARGET}_de.ts
        l10n/${TARGET}_pl.ts
    )
    qt_add_translations(${TARGET} TS_FILES ${TSFILES}
        LUPDATE_OPTIONS "-noobsolete"
    )
    

    If I comment out qt_add_translations macro then it links file but translation does not work.

    I have also found out that if I keep qt_add_translations but remove qt_finalize_target(${TARGET}) it works too.
    I need qt_finalize_target(${TARGET}) to make "allow location permissions" dialog working on macOS.

    Problem is not macOS related, the problem is on Linux too: https://github.com/KejPi/AbracaDABra/issues/171

    Everything is working fine with Qt < 6.8.
    Do you have any idea how to fix it?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      KaoN
      wrote on last edited by
      #2

      seem to this fix:
      https://codereview.qt-project.org/c/qt/qtbase/+/601223

      1 Reply Last reply
      1
      • K Offline
        K Offline
        KejPi
        wrote on last edited by
        #3

        Thanks for pointing that out, that is exactly the issue I have.
        According to related bug report I have removed

        set(CMAKE_AUTOUIC ON)
        set(CMAKE_AUTOMOC ON)
        set(CMAKE_AUTORCC ON)
        

        and replaced them by:

        qt_standard_project_setup()
        

        This seems to work for Qt 6.8.0 and also lower version (tested with 6.5.3).

        I am marking this issue as solved, thank you!

        1 Reply Last reply
        0
        • K KejPi has marked this topic as solved on

        • Login

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