Results 1 to 7 of 7

Thread: term does not evaluate to a function

  1. #1
    Join Date
    Feb 2006
    Posts
    51
    Thanks
    7

    Default term does not evaluate to a function

    Hi all

    I get an error which says: term does not evaluate to a function
    the following is my constructor
    Qt Code:
    1. CIm::CIm(QString filename, QWidget * p, const char * n, CV *Vi, WFlags f ) : ImBase( p, n ), m_Vi( Vi )
    To copy to clipboard, switch view to plain text mode 
    and the error occours on following twee lines:
    Qt Code:
    1. FileA = &(Vi()->getFileA());
    2. FileB = &(Vi()->getFileB());
    3.  
    4. if ( FileA)
    5. {
    6. //
    7. }
    8. if ( FileB )
    9. {
    10. //
    11. }
    To copy to clipboard, switch view to plain text mode 
    can someone help me?
    thanks in advance
    Love::Peace

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: term does not evaluate to a function

    how are FileA and FileB declared ??
    it seems u are using some function name without the brackets() ....

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

    Default Re: term does not evaluate to a function

    "Vi" is not a function (it's a variable) and you call it as such.

  4. #4
    Join Date
    Feb 2006
    Posts
    51
    Thanks
    7

    Default Re: term does not evaluate to a function

    Quote Originally Posted by aamer4yu View Post
    how are FileA and FileB declared ??
    it seems u are using some function name without the brackets() ....
    Qt Code:
    1. CFileA * FileA;
    2. CFileB * FileB;
    To copy to clipboard, switch view to plain text mode 

    and if i remove this these two line i do not get a compiler error..

    Qt Code:
    1. FileA = &(Vi()->getFileA());
    2.  
    3. FileB = &(Vi()->getFileB());
    To copy to clipboard, switch view to plain text mode 

    @wysota

    Vi is a function ans is made as such
    Qt Code:
    1. CVi *Vi() { return m_Vi; }
    To copy to clipboard, switch view to plain text mode 
    Love::Peace

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

    Default Re: term does not evaluate to a function

    No, it's not. You have a parameter "CV *Vi" in the constructor that shadows the function. Change the argument name.

  6. The following user says thank you to wysota for this useful post:

    :db:sStrong (18th April 2007)

  7. #6
    Join Date
    Feb 2006
    Posts
    51
    Thanks
    7

    Default Re: term does not evaluate to a function

    @Wyosta
    I cant change that argument because CV is a class and i assign a pointer
    to CV class and thats why it is "CV* Vi"
    Love::Peace

  8. #7
    Join Date
    Feb 2006
    Posts
    51
    Thanks
    7

    Default Re: term does not evaluate to a function

    Quote Originally Posted by wysota View Post
    No, it's not. You have a parameter "CV *Vi" in the constructor that shadows the function. Change the argument name.
    my mistake i got it u were right i change the name and it works
    Love::Peace

Similar Threads

  1. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04
  2. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  3. Qt 4.1.4 plugin QPSQL
    By jcr in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd June 2006, 22:55
  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. Replies: 25
    Last Post: 15th January 2006, 00:53

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.