Results 1 to 7 of 7

Thread: warning: 'bool QwtDoubleInterval::isValid() const' redeclared

  1. #1
    Join Date
    Oct 2009
    Posts
    90
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default warning: 'bool QwtDoubleInterval::isValid() const' redeclared

    hi

    what is this warning ?

    from plotter/plotterwidgets.h:16 (#include <qwt_scale_widget.h>)
    "c:/qwt-5.2/src/qwt_double_interval.h:264: warning: 'bool QwtDoubleInterval::isValid() const' redeclared without dllimport attribute after being referenced with dll linkage"

    regards
    navid

  2. #2
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: warning: 'bool QwtDoubleInterval::isValid() const' redeclared

    I am getting virtually the same error, trying to compile a Qwt demo with statically built Qt, on Windows 7. Ideas here would be greatly appreciated.

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: warning: 'bool QwtDoubleInterval::isValid() const' redeclared

    Ignore this warning or use a better compiler.

    Uwe

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: warning: 'bool QwtDoubleInterval::isValid() const' redeclared

    The problem is likely due to a conflict between the compilation flags used to build Qwt vs. Qt vs. the demo app. If you are using Qwt (as a DLL) with Qt (static), you must have QWT_DLL set but not QT_DLL. So the warning is telling you that you've mixed up QWT_DLL flags somewhere - there's a mismatch. Dig through the project settings for everything you are using and find it.

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

    MattPhillips (23rd January 2011)

  6. #5
    Join Date
    Aug 2009
    Posts
    140
    Thanks
    22
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: warning: 'bool QwtDoubleInterval::isValid() const' redeclared

    Hi,

    It looks like the compatibility was between release and debug versions. I was actually having this problem just getting Qwt to compile (the warning was a symptom of linker failure in my case). I knew I needed a Qwt static build to go along with my Qt one, and had commented out QwtDLL in qwtconfig.pri to that end. What I didn't do, though was change CONFIG to release in qwtbuild.pri. This also explains why I was having this problem just with Windows, since CONFIG += release on non-windows platforms by default. I'm pretty sure I built Qt in release mode for this--surely, not much point to a static debug build.

    Now I can't build my apps in debug mode, not surprisingly I guess--I get a Microsoft VC++ runtime error and

    QWidget: Must construct a QApplication before a QPaintDevice

    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    in the QtCreator Application Output box. This is trying to run the bode example (same for cpuplot). So I'll have to build Qt and Qwt separately in debug mode to be able to be able to build my app in debug mode? Seems a little surprising since you can build debug and release mode apps within a single Qt build, but oh well.

    Thanks--

    Matt

  7. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: warning: 'bool QwtDoubleInterval::isValid() const' redeclared

    From what I remember, out-of-the-box Qwt uses identical names for release and debug libraries and builds to a DLL. I create my own Visual Studio projects to build Qwt as a static library, and assign different names (following the Qt convention of adding a "d" suffix) to release and debug builds. In the MSVC world, debug and release libraries generally can't be mixed in an executable if one depends on the other (or if they are, it can lead to weird behavior).

    There is absolutely no issue with building Qwt as a static library and using it with a DLL version of Qt. That's the standard configuration for my apps. You -do- need to ensure that Qwt is built against the same version of Qt, though.

    Sorry, but I don't use QtCreator, so I don't know how to rework project files in that environment to make debug and release builds with different names.

  8. #7
    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: warning: 'bool QwtDoubleInterval::isValid() const' redeclared

    Quote Originally Posted by d_stranz View Post
    Sorry, but I don't use QtCreator, so I don't know how to rework project files in that environment to make debug and release builds with different names.
    qmake Code:
    1. TEMPLATE=lib
    2. TARGET= $$qtLibraryTarget(qwt)
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. please explain QUrl::isValid() to me
    By momesana in forum Qt Programming
    Replies: 5
    Last Post: 19th May 2010, 02:19
  2. QGLWidget::isValid() not valid in Qt-4.3.2?
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2008, 23:14
  3. QSqlQuery::isValid returns false
    By mismael85 in forum Qt Programming
    Replies: 24
    Last Post: 8th September 2008, 00:43
  4. const member and const method
    By mickey in forum General Programming
    Replies: 8
    Last Post: 9th April 2008, 10:44
  5. dllimport redeclared
    By miketigerwoods in forum Qt Programming
    Replies: 0
    Last Post: 6th July 2006, 20:05

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.