Results 1 to 10 of 10

Thread: undefined reference

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: undefined reference

    Thanks Zlatomir and others, that worked. I have to read and learn some more, thought that your answer wasn't necessary with Auto-Connect.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: undefined reference

    Auto-connect still needs a function to link to though, it can't guess what you want to do when you press that button

  3. #3
    Join Date
    May 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: undefined reference

    Yes that's the part i understand. Btw i do my stuf up till now in visual basic.
    What i don't understand is where do i declare a slot. From the textfinderexample i thought in textfinder.h witch i posted earlier but then i get the moc_textfinder.h error.
    Now i declared them both in header and ccp, no errors now.
    Also i am still figuring out the C++ approuch with main, header, source and preprocessing.

    Thanks, Digidas.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: undefined reference

    A slot is the same as any other normal C++ method, the "slots:" part is just for MOC (the C++ preprocessor removes it before invoking the compiler)

    Normally you would put the prototype of the function (the signature) in the class declaration, and then the body of the function in your .cpp file. For small functions, sometimes the body is included in the class declaration, but I always think it looks better to have a clear seperation - prototypes and class declarations in header file, code in cpp file.

Similar Threads

  1. Undefined reference to my signal
    By tomek in forum Newbie
    Replies: 9
    Last Post: 1st December 2011, 07:14
  2. undefined reference
    By jayreddy in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2009, 13:45
  3. Undefined reference to crt
    By derektaprell in forum Installation and Deployment
    Replies: 0
    Last Post: 20th October 2009, 08:34
  4. Undefined Reference To...
    By ManuMies in forum Qt Programming
    Replies: 6
    Last Post: 10th February 2009, 12:14
  5. Undefined reference
    By Salazaar in forum Newbie
    Replies: 12
    Last Post: 23rd May 2007, 10:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.