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. same filename cause multiple definition
Forum Updated to NodeBB v4.3 + New Features

same filename cause multiple definition

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 339 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.
  • N Offline
    N Offline
    Neether
    wrote on last edited by
    #1

    I have 2 file

    mainmodule/dispatcher.cpp
    log4qt/dispatcher.cpp

    just have the same name,there is no connection between this two files.

    when I run build,I get "multiple definition" error.

    I found same issue in here 13 years ago https://www.qtcentre.org/threads/40338-qmake-multiple-definition
    and have no solution.

    Christian EhrlicherC 1 Reply Last reply
    0
    • N Neether

      I have 2 file

      mainmodule/dispatcher.cpp
      log4qt/dispatcher.cpp

      just have the same name,there is no connection between this two files.

      when I run build,I get "multiple definition" error.

      I found same issue in here 13 years ago https://www.qtcentre.org/threads/40338-qmake-multiple-definition
      and have no solution.

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Neether said in same filename cause multiple definition:

      have no solution

      Don't use the same filename in one qmake project.

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

      N 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @Neether said in same filename cause multiple definition:

        have no solution

        Don't use the same filename in one qmake project.

        N Offline
        N Offline
        Neether
        wrote on last edited by
        #3

        @Christian-Ehrlicher thank you , This feature is unbelievable in 2024

        Pl45m4P C Christian EhrlicherC 3 Replies Last reply
        0
        • N Neether

          @Christian-Ehrlicher thank you , This feature is unbelievable in 2024

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @Neether said in same filename cause multiple definition:

          thank you , This feature is unbelievable in 2024

          CMake became the "standard" or recommendation for Qt6+.
          If you want to have your files named like this, you could move to CMake


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          1
          • N Neether

            @Christian-Ehrlicher thank you , This feature is unbelievable in 2024

            C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            @Neether You can always include log4qt by building it separately as a library (dynamic or static).

            1 Reply Last reply
            0
            • N Neether

              @Christian-Ehrlicher thank you , This feature is unbelievable in 2024

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

              @Neether said in same filename cause multiple definition:

              This feature is unbelievable in 2024

              This has nothing to do with a 'feature' or similar. It's just a problem of duplicate symbols in your code - this is simply not allowed (even not in other programming languages).

              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

              • Login

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