Results 1 to 4 of 4

Thread: undefined reference to `NESA::filterMeasurements(QStringList&, QString)

  1. #1
    Join Date
    May 2010
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: undefined reference to `NESA::filterMeasurements(QStringList&, QString)

    I cannot compile my code due to the message above.

    header:
    Qt Code:
    1. class NESA : public QMainWindow
    2. {
    3. ...
    4. QStringList measurementNames;
    5.  
    6. void filterMeasurements(QStringList &list, QString measurementName);
    7. }
    To copy to clipboard, switch view to plain text mode 

    source:
    Qt Code:
    1. void filterMeasurements(QStringList &list, QString measurementName)
    2. {
    3. bool test = false;
    4. foreach (QString name, list)
    5. {
    6. if (name == measurementName) test = true;
    7. }
    8. if (!test) list.append(measurementName);
    9. }
    To copy to clipboard, switch view to plain text mode 

    I call it with filterMeasurements(measurementNames, "x");

    Any guess? Thx!

    Oh, and of course, the header is included in source.

    #include "nesa.h"

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: undefined reference to `NESA::filterMeasurements(QStringList&, QString)

    This line:
    Qt Code:
    1. void filterMeasurements(QStringList &list, QString measurementName)
    To copy to clipboard, switch view to plain text mode 
    should be something like:
    Qt Code:
    1. void NESA::filterMeasurements(QStringList &list, QString measurementName)
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to Zlatomir for this useful post:

    falconium (23rd March 2011)

  4. #3
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: undefined reference to `NESA::filterMeasurements(QStringList&, QString)

    Just a quick guess, but would it not be:

    void NESA::filterMeasurements(......

  5. The following user says thank you to progman for this useful post:

    falconium (23rd March 2011)

  6. #4
    Join Date
    May 2010
    Posts
    86
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: undefined reference to `NESA::filterMeasurements(QStringList&, QString)

    Uhhh, thanks, guys! What a simple mistake that caused headache for a long time.

Similar Threads

  1. Undefined reference
    By eekhoorn12 in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2011, 15:45
  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. Replies: 4
    Last Post: 31st January 2008, 20:44

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.