Results 1 to 11 of 11

Thread: Public routines

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2012
    Posts
    33
    Qt products
    Qt4

    Default Public routines

    I have a routine in my MainWindow, and I declared public this routine:


    In MainWindow.cpp

    Qt Code:
    1. void MainWindow::Read_Ambiente()
    2. {
    3. }
    To copy to clipboard, switch view to plain text mode 


    In MainWindow.h

    Qt Code:
    1. public:
    2. void Read_Ambiente();
    To copy to clipboard, switch view to plain text mode 



    In another form I want to use this routine:

    In Diagnostica.cpp

    Qt Code:
    1. #include "mainwindow.h"
    2. extern void Read_Ambiente();
    To copy to clipboard, switch view to plain text mode 


    If I don't use this routine "Read_Ambiente" in the second form, there are no errors.

    When I use the routine, I have this error from the linker:

    diagnostica.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl Read_Ambiente(void)" (?Read_Ambiente@@YAXXZ) referenced in function "private: virtual bool __thiscall Diagnostica::eventFilter(class QObject *,class QEvent *)" (?eventFilter@Diagnostica@@EAE_NPAVQObject@@PAVQEv ent@@@Z)
    Last edited by wysota; 5th April 2012 at 12:26. Reason: missing [code] tags

Similar Threads

  1. Public variables
    By eltecprogetti in forum Qt Programming
    Replies: 8
    Last Post: 6th April 2012, 12:58
  2. Replies: 1
    Last Post: 27th August 2009, 05:41
  3. Qt Public Repository Launched!
    By lpotter in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2009, 00:38
  4. checksum routines?
    By gfunk in forum Qt Programming
    Replies: 2
    Last Post: 20th September 2007, 00:26
  5. Qt and CGI routines
    By jcr in forum Qt Programming
    Replies: 6
    Last Post: 28th November 2006, 06:15

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.