Results 1 to 3 of 3

Thread: reference problem

  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default reference problem

    Hi,

    I have the following problem:
    Here is a class constructor:
    Qt Code:
    1. MTelemetry(QString sPort,quint16 dataPort,quint16 viewPort,QString logFileName,QString dataServer="localhost",
    2. QString viewServer="localhost",QObject *parent = 0) throw(MException): QThread(parent)
    To copy to clipboard, switch view to plain text mode 
    And then, I subclass MTelemtry so:
    Qt Code:
    1. class MCamCon : public MTelemetry
    2. {
    3. Q_OBJECT
    4. private:
    5.  
    6. public:
    7. MCamCon(QString sPort,quint16 dataPort,quint16 viewPort=0,QString dataServer="localhost",
    8. QString viewServer="localhost",QObject *parent = 0);
    9.  
    10. //some code
    11. };
    To copy to clipboard, switch view to plain text mode 

    And the implementatio:
    Qt Code:
    1. MCamCon::MCamCon(QString sPort, quint16 dataPort,quint16 viewPort,QString dataServer,
    2. QString viewServer,QObject *parent)
    3. : MTelemetry(sPort, dataPort, viewPort, dataServer, viewServer, parent)
    4. {
    5. }
    To copy to clipboard, switch view to plain text mode 

    The compiler complains:
    mcamcon.cpp:25: error: no matching function for call to ‘TM::MTelemetry::MTelemetry(QString&, quint16&, quint16&, QString&, QString&, QObject*&)’
    ../../Globals/include/mtelemetry.h:198: note: candidates are: TM::MTelemetry::MTelemetry(QString, quint16, quint16, QString, QString, QString, QObject*)
    Yet as you can see, I am not passing by reference...

    What am I missing here?

    Thanks.
    Last edited by jacek; 3rd October 2006 at 17:19. Reason: wrapped too long lines

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: reference problem

    The candidate has one more QString argument

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: reference problem

    Doughp...
    Its time for me to take a break....
    Thanks.

Similar Threads

  1. how to correctly compile threads support?
    By srhlefty in forum Installation and Deployment
    Replies: 9
    Last Post: 25th June 2006, 19:15
  2. Strange error while using Q3Canvas
    By Kapil in forum Newbie
    Replies: 13
    Last Post: 15th June 2006, 19:36
  3. undefined reference to fftw libraries
    By kmyadam in forum General Programming
    Replies: 2
    Last Post: 9th March 2006, 01:01
  4. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11
  5. Problem: Undefined reference
    By stiank81 in forum Qt Programming
    Replies: 4
    Last Post: 16th February 2006, 14:17

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.