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. Fedora only - moc file generates multiple definitions for `QtPrivate::IsFloatType_v<_Float16>'
Forum Updated to NodeBB v4.3 + New Features

Fedora only - moc file generates multiple definitions for `QtPrivate::IsFloatType_v<_Float16>'

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 79 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    SB5K
    wrote last edited by
    #1

    When I try to build a rather simple projet that builds on Windows, on Fedora, I get
    usr/bin/ld: CMakeFiles/GraphicsViewTest2.dir/main.cpp.o:(.rodata+0x10): multiple definition of QtPrivate::IsFloatType_v<_Float16>'; CMakeFiles/GraphicsViewTest2.dir/GraphicsViewTest2_autogen/mocs_compilation.cpp.o:(.rodata+0x10): first defined here /usr/bin/ld: CMakeFiles/GraphicsViewTest2.dir/graphicsviewtest2mainwindow.cpp.o:(.rodata+0x10): multiple definition of QtPrivate::IsFloatType_v<_Float16>'; CMakeFiles/GraphicsViewTest2.dir/GraphicsViewTest2_autogen/mocs_compilation.cpp.o:(.rodata+0x10): first defined here
    These seem to be the same place.
    The SAME project builds on Windows, but not Fedora
    And I have deleted the build directory

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote last edited by
      #2

      How did you create your cmake environment? and can you try to build your project using qmake as a test?

      These kinds of problems are often related to build environment that hasn't been updated after adding files, or a partial build where artifacts are not completely deleted before a rebuild.

      The linker error is telling you that more than one object file is trying to include the same symbol. This is often because of an #include guard not being honored, or an older .o file (an artifact)

      S 1 Reply Last reply
      0
      • Kent-DorfmanK Kent-Dorfman

        How did you create your cmake environment? and can you try to build your project using qmake as a test?

        These kinds of problems are often related to build environment that hasn't been updated after adding files, or a partial build where artifacts are not completely deleted before a rebuild.

        The linker error is telling you that more than one object file is trying to include the same symbol. This is often because of an #include guard not being honored, or an older .o file (an artifact)

        S Offline
        S Offline
        SB5K
        wrote last edited by SB5K
        #3

        @Kent-Dorfman the error gives the SAME file - the moc file. What is strange is clean builds on Windows works (my copy using Beyond Compare leaves out the .user and build files) but not clean builds on Fedora.
        The CMake environment was done using QtCreator. And as I said, I deleted the build directory on Fedora and the problem still occurs. Still trying to get my Ubuntu environment to work (CMake can't fine Qt; I've fixed that before on older systems, but did not have time tonight)
        So far, it seems to be something due to Fedora or Linux. I did reinstall Qt from qt.io instead of using what fedora wanted to install. Same problem. This makes me wonder if it is due to differences between MingW (on Windows) and g++ on Fedora.
        If I try CMake directly on Fedora, it can't find Qt. Once I fix that on Ubuntu, I will see if I can fix it on Fedora.
        Thank you for your answer, and I will get more information

        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