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. Qt 5.3 ERROR: multiple definition of 'visu_idx"
Qt 6.11 is out! See what's new in the release blog

Qt 5.3 ERROR: multiple definition of 'visu_idx"

Scheduled Pinned Locked Moved General and Desktop
11 Posts 3 Posters 6.3k 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.
  • A Offline
    A Offline
    ad5xj
    wrote on last edited by
    #1

    This is a new error for me. I have not encountered it before so I am unsure what to provide for help other than to say this is a compile of a library and the errors occur when linking.

    Multiple modules are named in multiple areas (.o and .cpp) .

    The complete error messages read:
    "multiple definition of 'visu' modulename.cpp
    first defined here modulename.cpp"

    "multiple definition of 'visu_idx' modulename.cpp
    first defined here (.bss+3000)
    in function 'qt_noop()': modulename.o"

    The project has been cleaned completely and qmake has been run to create Makefile and
    re-compiled with no change in results as stated.

    One more observation; I am running QtCreator in a window and the console output says:
    "Cannot find absolute location of file (.bss+3000)"

    As stated, I have not seen this error before and have no idea what it all means.

    Ken AD5XJ

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

      Hi,

      Do you have by any chance several files that have the same name ?

      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
      • A Offline
        A Offline
        ad5xj
        wrote on last edited by
        #3

        Nope. Not so luck as that.

        Ken AD5XJ

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ad5xj
          wrote on last edited by
          #4

          UPDATE:

          Just for grins I moved the project to a Windows partition and recompiled. Exactly the same result.

          Not that this is surprising, but it does indicate something in the code or the way the compiler / linker views it.

          Hope this helps.

          Ken AD5XJ

          1 Reply Last reply
          0
          • Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            What exactly is visu and visu_idx? Is it by any chance a variable defined (instead of just declared) in a header?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ad5xj
              wrote on last edited by
              #6

              Well....this is why I posted it. I have no idea what the error means nor what in the code has prompted it. As stated; I have never seen this before. So, other than the error message I have no clue what to say.

              There is definitely no module or variable name in my shared library project with anything close to this name "visu_idx".

              Ken AD5XJ

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

                Are you on Windows ?

                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
                • A Offline
                  A Offline
                  ad5xj
                  wrote on last edited by
                  #8

                  Well my original post was about a project started on Linux. I have since moved it to a Windows partition just to get a comparison. No difference. Very same errors; which led to the update post above.

                  Ken AD5XJ

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    ad5xj
                    wrote on last edited by
                    #9

                    UPDATE 2:

                    I just came across an interesting page about the gnu linker:
                    http://www.sourceware.org/binutils/docs-2.10/ld_3.html

                    This page seems to indicate the problem may lie in the linker script specifying that the .bss is the output section specification in the script.

                    I am not familiar at all with the linker internals so this means little to me, other than to say the linker seems to be having trouble with multiple definitions for the output section of the linker script (if I am understanding the information correctly).

                    Someone much more familiar with the linker would know much better than I.

                    Ken AD5XJ

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      ad5xj
                      wrote on last edited by
                      #10

                      UPDATE:

                      After having set this particular problem aside, I continued working on various sections of the library. Eventually, I tried a re-compile and this time I got a more cogent error message similar in nature to the above but this time siting a line in a moc_ file.

                      The line pointed to is this:
                      @
                      void DlgSettings::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
                      {
                      if (_c == QMetaObject::InvokeMetaMethod) {
                      DlgSettings *_t = static_cast<DlgSettings *>(_o);
                      switch (_id) {
                      case 0: _t->signalSettingsUpdated(); break;
                      default: ;
                      }
                      } else if (_c == QMetaObject::IndexOfMethod) {
                      int *result = reinterpret_cast<int >(_a[0]);
                      void **func = reinterpret_cast<void **>(_a[1]);
                      {
                      typedef void (DlgSettings::
                      _t)();
                      if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&DlgSettings::signalSettingsUpdated)) {
                      *result = 0;
                      }
                      }
                      }
                      Q_UNUSED(_a);
                      }
                      @
                      The error is:
                      multiple definition of 'visu' in moc_mymodule.cpp line 63 (code shown above)
                      first defined here mycustomwidget.cpp line 102 (custom widget class implementation)

                      This custom widget was not even used in the dialog DlgSettings.

                      very confusing

                      Ken AD5XJ

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

                        Can you show your custom widget code ?

                        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