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. Qt5 Mac OS 10.7 "ld: 2 duplicate symbols for architecture x86_64"
Forum Updated to NodeBB v4.3 + New Features

Qt5 Mac OS 10.7 "ld: 2 duplicate symbols for architecture x86_64"

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 4.3k Views 2 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.
  • M Offline
    M Offline
    mourad_bilog
    wrote on last edited by
    #1

    Hello everybody,

    I've an application witch is compiled correctly with Qt5 under Windows using Qt Creator. But, the same source code compiled on Mac OS 10.7 using Qt Creator generate the following error

    duplicate symbol __Z23qInitResources_autonomev in: qrc_autonome.o duplicate symbol __Z26qCleanupResources_autonomev in: qrc_autonome.o 
    ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Debug/Autonome.app/Contents/MacOS/Autonome] Error 1 
    09:00:44: Le processus "/usr/bin/make" s'est terminé avec le code 2. Erreur lors de la compilation/déploiement du projet autonome (kit : Desktop Qt 5.5.1 clang 64bit) When executing step "Make"
    

    I've tried for 2 days to search and resolve this common problem but It persists.
    Kwoning that when I comment the REOURCES entry in the pri file, application is compiled correctly.

    Can anyone tell what's wrong and how to fix this really blocant problem.

    Best regards.

    M 1 Reply Last reply
    0
    • M mourad_bilog

      Hello everybody,

      I've an application witch is compiled correctly with Qt5 under Windows using Qt Creator. But, the same source code compiled on Mac OS 10.7 using Qt Creator generate the following error

      duplicate symbol __Z23qInitResources_autonomev in: qrc_autonome.o duplicate symbol __Z26qCleanupResources_autonomev in: qrc_autonome.o 
      ld: 2 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Debug/Autonome.app/Contents/MacOS/Autonome] Error 1 
      09:00:44: Le processus "/usr/bin/make" s'est terminé avec le code 2. Erreur lors de la compilation/déploiement du projet autonome (kit : Desktop Qt 5.5.1 clang 64bit) When executing step "Make"
      

      I've tried for 2 days to search and resolve this common problem but It persists.
      Kwoning that when I comment the REOURCES entry in the pri file, application is compiled correctly.

      Can anyone tell what's wrong and how to fix this really blocant problem.

      Best regards.

      M Offline
      M Offline
      mostefa
      wrote on last edited by
      #2

      Hi @mourad_bilog

      In qt creator there is a compile output tab is it possible to share with us the build output of this tab , when trying to build your project?

      alt text

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mourad_bilog
        wrote on last edited by
        #3

        Thanks for replying,

        Below the compile output
        0_1487865099663_CompilationOutput.png

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mostefa
          wrote on last edited by
          #4

          @mourad_bilog

          I am not seeing your copile output?

          Are sure you correctly made a copy, paste?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mourad_bilog
            wrote on last edited by
            #5

            I've made a sreen-captured, did you seen the image ?

            Anyway, below the build ouput text containg the error

            Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
            Target: x86_64-apple-darwin11.4.2
            Thread model: posix
             "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -headerpad_max_install_names -macosx_version_min 10.7.0 -o Debug/Autonome.app/Contents/MacOS/Autonome -lcrt1.10.6.o -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -rpath /Users/admin/Qt/5.5/clang_64/lib AllergieQueryModel.o checkboxdelegate.o excipientmodel.o frmalerte.o frmallergie.o frmapropos.o frmfiltre.o frmhelp.o frminter.o frmlisteordo.o frmmedic.o frmmono.o frmordo.o frmparam.o frmPatient.o frmposo.o frmposolibre.o frmpraticien.o frmrecherche.o frmrechpat.o frmrechpatient.o frmremp.o frmusers.o frmwindow.o intermodel.o journaldb.o Licence.o licencewizard.o main.o md5.o medicmodel.o mysortfilterproxymodel.o OrdoApi.o ordodoc.o Outil.o paramordo.o phasedelegate.o printpreview.o qrc_autonome.o qsqlquerymedic.o qsqlreadtablemodel.o RechPre.o remptablemodel.o struct_theria.o termequerymodel.o textedit.o theriabd.o qrc_autonome.o moc_AllergieQueryModel.o moc_checkboxdelegate.o moc_excipientmodel.o moc_frmalerte.o moc_frmallergie.o moc_frmapropos.o moc_frmfiltre.o moc_frmhelp.o moc_frminter.o moc_frmlisteordo.o moc_frmmedic.o moc_frmmono.o moc_frmordo.o moc_frmparam.o moc_frmPatient.o moc_frmposo.o moc_frmposolibre.o moc_frmpraticien.o moc_frmrecherche.o moc_frmrechpat.o moc_frmrechpatient.o moc_frmremp.o moc_frmusers.o moc_frmwindow.o moc_intermodel.o moc_journaldb.o moc_licencewizard.o moc_medicmodel.o moc_mysortfilterproxymodel.o moc_ordodoc.o moc_paramordo.o moc_phasedelegate.o moc_printpreview.o moc_qsqlquerymedic.o moc_qsqlreadtablemodel.o moc_RechPre.o moc_remptablemodel.o moc_termequerymodel.o moc_textedit.o -framework QtPrintSupport -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework QtNetwork -framework QtSql -framework QtXml -framework OpenGL -framework AGL -lstdc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.2/lib/darwin/libclang_rt.osx.a -F/Users/admin/Qt/5.5/clang_64/lib
            duplicate symbol __Z23qInitResources_autonomev in:
                qrc_autonome.o
            duplicate symbol __Z26qCleanupResources_autonomev in:
                qrc_autonome.o
            ld: 2 duplicate symbols for architecture x86_64
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
            make: *** [Debug/Autonome.app/Contents/MacOS/Autonome] Error 1
            12:04:00: Le processus "/usr/bin/make" s'est terminé avec le code 2.
            Erreur lors de la compilation/déploiement du projet autonome (kit : Desktop Qt 5.5.1 clang 64bit)
            When executing step "Make"
            12:04:00: Temps écoulé : 03:34.
            
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Do you have several qrc files ?

              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
              1
              • M Offline
                M Offline
                mourad_bilog
                wrote on last edited by
                #7

                Hi SGaist,

                There's only one qrc file in the application.

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

                  Can you show your .pro file ?

                  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
                  • M Offline
                    M Offline
                    mourad_bilog
                    wrote on last edited by
                    #9

                    I've solved the problem by generating a new qrc_app.cpp file.

                    Thanks for your responses.

                    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