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 Due to automatic update of moc_application.cpp file
QtWS25 Last Chance

Error Due to automatic update of moc_application.cpp file

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 507 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.
  • S Offline
    S Offline
    saurabh162
    wrote on last edited by
    #1

    Dear Developer,

    Please help me solve following error.

    In my application first by mistake I have added slot "cursorPositionChanged" for Line Edit widget. Corresponding to which I get

    1. on_LineEdit_cursorPositionChanged() slot in my application.cpp file

    2. case 31: _t->on_stepLineEdit_cursorPositionChanged((reinterpret_cast< int()>(_a[1])),(reinterpret_cast< int()>(_a[2]))); break;

    entry in my moc_application.cpp file.

    Later, after realizing my mistake when I have deleted above given code and rebuild my application I get following error.

    error: undefined reference to `Application::on_LineEdit_cursorPositionChanged(int, int)' in moc_application.cpp file

    Please inform me from where code:

    case 31: _t->on_stepLineEdit_cursorPositionChanged((reinterpret_cast< int()>(_a[1])),(reinterpret_cast< int()>(_a[2]))); break;

    appear in my moc_application.cpp file after I do "Clean all" and "Rebuild all" , even after I have deleted it from moc_application.cpp file before rebuilding my application.

    Kindly inform me if you need any information from me.

    Thank you very much :)

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Try removing the whole build directory and building again. Also, run qmake manually in Qt Creator (right click on your project and select "Run qmake"), then build.

      I have deleted above given code

      So you have removed the slot from both application.h and application.cpp?

      (Z(:^

      1 Reply Last reply
      2
      • S Offline
        S Offline
        saurabh162
        wrote on last edited by
        #3

        Hello Sierdzio,

        Thank you very much for your reply actually I forget to remove slot from application.h file.

        After I deleted declaration of slot from .h file everything went fine.

        Thank you :)

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          You're welcome. Happy coding :-)

          (Z(:^

          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