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. error in generate automoc.cpp file???
QtWS25 Last Chance

error in generate automoc.cpp file???

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 655 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.
  • cerrC Offline
    cerrC Offline
    cerr
    wrote on last edited by cerr
    #1

    Hi,

    make gives me an error in the by cmake autogenerated _automo.cpp file:
    In particular, make tells me:

    In file included from /home/ron/src/scaper/build/scaper_automoc.cpp
    /home/ron/src/scaper/build/moc_dialog.cpp:21:8: error: redefinition of ‘struct qt_meta_stringdata_ScaperDialog_t’ 
    struct qt_meta_stringdata_ScaperDialog_t {
    

    I'm not sure how I can resolve this... anyone...?
    Thank you!

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Do you include the moc file somewhere in your sources? If so please remove it and try again.

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

      cerrC 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        Do you include the moc file somewhere in your sources? If so please remove it and try again.

        cerrC Offline
        cerrC Offline
        cerr
        wrote on last edited by
        #3

        @christian-ehrlicher said in error in generate automoc.cpp file???:

        Do you include the moc file somewhere in your sources? If so please remove it and try again.
        No I atually don't, a quick grep in my source dir only returned:

        ron@regDesktopHome:~/src/scaper$ grep -rn "moc" * | grep -v cmake | grep -vi make                                                                                                                                                                             
        build/moc_scacfg.cpp:15:#error "This file was generated using the moc from 5.5.1. It"                                                                                                                                                                         
        build/moc_scacfg.cpp:17:#error "(The moc has changed too much.)"                                                                                                                                                                                              
        build/scaper_automoc.cpp:2:#include "moc_dialog.cpp"                                                                                                                                                                                                          
        build/scaper_automoc.cpp:3:#include "moc_dialog.cpp"                                                                                                                                                                                                          
        build/scaper_automoc.cpp:4:#include "moc_scacfg.cpp"                                                                                                                                                                                                          
        build/moc_dialog.cpp:15:#error "This file was generated using the moc from 5.5.1. It"                                                                                                                                                                         
        build/moc_dialog.cpp:17:#error "(The moc has changed too much.)"                                                                                                                                                                                              
        llvm-project/libcxx/utils/google-benchmark/test/benchmark_gtest.cc:4:#include "gmock/gmock.h"   
        

        Whjat is expected - I assume. I'm a relative Qt newbie if it isn't obvious yet....
        If you would like to have a look at my sources, git clone https://github.com/stdcerr/scaper.git

        aha_1980A 1 Reply Last reply
        0
        • cerrC cerr

          @christian-ehrlicher said in error in generate automoc.cpp file???:

          Do you include the moc file somewhere in your sources? If so please remove it and try again.
          No I atually don't, a quick grep in my source dir only returned:

          ron@regDesktopHome:~/src/scaper$ grep -rn "moc" * | grep -v cmake | grep -vi make                                                                                                                                                                             
          build/moc_scacfg.cpp:15:#error "This file was generated using the moc from 5.5.1. It"                                                                                                                                                                         
          build/moc_scacfg.cpp:17:#error "(The moc has changed too much.)"                                                                                                                                                                                              
          build/scaper_automoc.cpp:2:#include "moc_dialog.cpp"                                                                                                                                                                                                          
          build/scaper_automoc.cpp:3:#include "moc_dialog.cpp"                                                                                                                                                                                                          
          build/scaper_automoc.cpp:4:#include "moc_scacfg.cpp"                                                                                                                                                                                                          
          build/moc_dialog.cpp:15:#error "This file was generated using the moc from 5.5.1. It"                                                                                                                                                                         
          build/moc_dialog.cpp:17:#error "(The moc has changed too much.)"                                                                                                                                                                                              
          llvm-project/libcxx/utils/google-benchmark/test/benchmark_gtest.cc:4:#include "gmock/gmock.h"   
          

          Whjat is expected - I assume. I'm a relative Qt newbie if it isn't obvious yet....
          If you would like to have a look at my sources, git clone https://github.com/stdcerr/scaper.git

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @cerr wipe the complete build directory and try again.

          Regards

          Qt has to stay free or it will die.

          1 Reply Last reply
          2
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Your headers are twice in your repo.

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

            cerrC 1 Reply Last reply
            3
            • Christian EhrlicherC Christian Ehrlicher

              Your headers are twice in your repo.

              cerrC Offline
              cerrC Offline
              cerr
              wrote on last edited by cerr
              #6

              @christian-ehrlicher said in error in generate automoc.cpp file???:

              Your headers are twice in your repo.

              Yes, that was it, I had created the include/ and missed to delete the files outside it! That solved it! Thanks! :)

              1 Reply Last reply
              1

              • Login

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