Results 1 to 3 of 3

Thread: ISO C++ forbids declaration of plot with no type error

  1. #1
    Join Date
    Aug 2010
    Posts
    28
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default ISO C++ forbids declaration of plot with no type error

    I have a strange issue that did not occur with the previous version of this project.

    I need to add 3x QWT plots as promoted widgets to my application, when I add the first, everything compiles perfectly, when I add the second, BOTH plots error out claiming they were

    Not declared in this scope
    Expected type-specifier before plot
    Expected ; before plot

    I am using the latest Qt Creator and the latest stable QWT.

    I did this in a previous project with the exact same methodology and everything compiled fine.

    Any advice would be great.

    -Gavin

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ISO C++ forbids declaration of plot with no type error

    Post some code, or a minimum compilable example.

  3. #3
    Join Date
    Aug 2010
    Posts
    28
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ISO C++ forbids declaration of plot with no type error

    Solved it.

    The issue was with the:
    #ifndef _PLOT_ONE_H
    #define _PLOT_ONE_H 1

    at the top of each plot being duplicated.

    It was a copy/paste oversight on my part. I needed three identically set up plots but each plotting different data and I missed the IFNDEF.

Similar Threads

  1. C++ forbids declarations with no type
    By brianc in forum Newbie
    Replies: 3
    Last Post: 5th August 2010, 23:09
  2. Replies: 13
    Last Post: 31st July 2010, 15:19
  3. Replies: 12
    Last Post: 29th April 2010, 13:22
  4. forbids declaration of QHash with no type
    By nina1983 in forum Qt Programming
    Replies: 4
    Last Post: 16th July 2008, 13:05
  5. Forward Class declaration ERROR
    By nleverin in forum Qt Programming
    Replies: 1
    Last Post: 30th July 2007, 08:35

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.