Results 1 to 4 of 4

Thread: function call

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Location
    Vienna / Austria
    Posts
    54
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default function call

    In a slot function of a class a want to call another function of this class.

    When I do this, I got following exception at the linking process:

    Qt Code:
    1. undefined reference to `ClientSocket::myDecodeTcpMsg(unsigned long, unsigned char*)'
    2.  
    3. *** Exited with status: 2 ***
    To copy to clipboard, switch view to plain text mode 

    Here are some fragments of my Source Code:

    Qt Code:
    1. void ClientSocket::readRequest()
    2. {
    3. char TcpBuffer[1500];
    4. qint64 Size;
    5. qint64 result_code;
    6. dword dwMsgLength;
    7.  
    8. Size = bytesAvailable();
    9. result_code = read ((char *) TcpBuffer, Size);
    10.  
    11. dwMsgLength = Size;
    12.  
    13. myDecodeTcpMsg (dwMsgLength, (unsigned char *) TcpBuffer);
    14. }
    To copy to clipboard, switch view to plain text mode 

    Here is the slot function readRequest in which I want to call the function myDecodeTcpMsg(...)

    Qt Code:
    1. connect(this, SIGNAL(readyRead()), this, SLOT(readRequest()));
    To copy to clipboard, switch view to plain text mode 

    Here is the Signal & Slot connection which "enables" the readRequest() function

    Qt Code:
    1. class ClientSocket : public QTcpSocket
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. ClientSocket(QObject *parent = 0);
    7.  
    8. void myDecodeTcpMsg(dword dwLength, byte* pbData);
    9.  
    10. signals:
    11. void sendResponseSignal();
    12.  
    13. private slots:
    14. void readRequest();
    15.  
    16. private:
    17. quint16 nextBlockSize;
    18. };
    To copy to clipboard, switch view to plain text mode 

    The Headerfile looks like this!
    Last edited by Walsi; 12th June 2007 at 08:57.

Similar Threads

  1. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 14:55
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  3. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  4. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  5. virtual overloaded functions and base class function call...
    By nouknouk in forum General Programming
    Replies: 7
    Last Post: 11th March 2006, 21:26

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.