Results 1 to 20 of 22

Thread: qHash(double) problem with Qt 4.6 (tp1)

Hybrid View

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

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    Simply remove the offending line in qwt_valuelist.h

    Uwe

  2. #2

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    Thanks Uwe,

    I tried to comment out the line, still getting the same compilation error

    C:/qwt-5.1.2/../../Qt/2009.05/qt/include/QtCore/../../src/corelib/tools/qhash.h:875: error: call of overloaded 'qHash(const double&)' is ambiguous


    Qt Code:
    1. #if defined(QWT_TEMPLATEDLL)
    2.  
    3. #if QT_VERSION < 0x040300
    4. // Some compilers have problems,
    5. // without a qHash(double) implementation
    6. #include <qset.h>
    7. #include <qvector.h>
    8. inline uint qHash(double key) { return uint(key); }
    9. #endif
    10.  
    11. // MOC_SKIP_BEGIN
    12. template class QWT_EXPORT QList<double>;
    13. // MOC_SKIP_END
    14.  
    15. #endif // QWT_TEMPLATEDLL
    To copy to clipboard, switch view to plain text mode 

    How can i check if QT_VERSION is taking the correct value ?

    Is there any other workaround for this issue

    Regards,

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

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    Quote Originally Posted by hassenman View Post
    I tried to comment out the line, still getting the same compilation error...
    Then try harder: a compiler can't fail at a line, that has been removed.

    More explicite: the offending line is the line exporting the template, but you can remove the complete QWT_TEMPLATEDLL scope ( or use qwt_valuelist.h from SVN 5.2 branch. )

    Uwe

  4. #4
    Join Date
    Feb 2010
    Location
    Uppsala
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    Im' having the same problem but in another file qhash.h. Can someone summon up, simple english, how to work around ambiguous qhash call?

    c:/tools/Qt/2010.01/qt/include/QtCore/../../src/corelib/tools/qhash.h:875: error: call of overloaded 'qHash(const double&)' is ambiguous

    Getting the same problem both on commandline and QT Creator
    QT 4.6.1 2010.01
    QWT 5.2.0
    g++ 4.4.0 (gcc)

    brg
    Jore

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

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    svn co https://qwt.svn.sourceforge.net/svnroot/qwt/branches/qwt-5.2

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

    Jore (1st March 2010)

  7. #6
    Join Date
    Sep 2009
    Location
    phoenix, AZ
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    SOLUTION

    comment line 48 in the qwt_valuelish.h"
    //template class QWT_EXPORT QList<double>;

    no need to export this symbol !~!

    Michael

  8. #7
    Join Date
    Feb 2010
    Location
    Uppsala
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    Failed Plugin
    QWT_designer_plugin5.dll uses incompatible QT library. Expected build key "Windows msvc release full", got "Windows mingw release full"
    (yes, I'm a newbie)

    Both the project where I want to use qwt and qwt is compiled for Release. QT is configured for mingw, I do not want to use microsoft visual studio.

    What am I doing wrong?
    (Why is QT expecting msvc when I run it as mingw, do I have to recompile entire QT?)

  9. #8
    Join Date
    Mar 2010
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    Hi

    I am having exactly the same problem.
    Using QT4.6.2 and mingw on win7 (the OS may be risky, but considering the fact that many XP-users have the same problem, I don't think that this is an issue).
    Compiling qwt-5.2 works fine, but then the plugin does not seem to install correctly in QTDesigner. That is - it works in the "standalone" version of designer but not inside QTCreator. Here, I get the same error as Jore even though I am nowhere using msvc.

    I have tried to get the newst qwt (5.3 or 6.0? the trunk from the svn) and that does not compile at all.

    Does anyone know how to solve this?
    Many thanks in advance!

  10. #9
    Join Date
    Mar 2010
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    I made it!
    To get it to work, I had to recompile QTCreator. Which seems to confirm that the creator in the binaries is compiled using msvc while the rest has been compiled with mingw (or here it does not matter).
    In any case, all you have to do is download the QTCreator source (from trolltech), compile it from within the running (old) creator using mingw and then start it. Don't forget to set the PATH variable as it is supposed to be and you are good to go.

    This is an EXTREMELY annoying problem, although I believe there is no one to blame really. But it would be nice if it could be documented somewhere, for QT as well as for qwt!

  11. The following user says thank you to kyamon for this useful post:

    Jore (3rd March 2010)

  12. #10
    Join Date
    Dec 2008
    Location
    California, USA
    Posts
    18
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    Thank you OverTheOcean - commenting line 48 in qwt_valuelist.h fixed this compile plroblem in MS VS2005

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

    Default Re: qHash(double) problem with Qt 4.6 (tp1)

    This is an EXTREMELY annoying problem, although I believe there is no one to blame really. But it would be nice if it could be documented somewhere, for QT as well as for qwt!
    Ok you believe Qt creator is not able to build Qt applications with a different compiler, than the one it had been build with. I can imagine, that it is not true when you carefully avoid using the wrong libs - but anyway.

    What exactly do you expect from the documentation of a library like Qwt - a note indicating, that you shouldn't try to link binaries built from incompatible compilers ?

    On Linux systems you have a distribution ( and package maintainers ) taking care of dependencies and possible incompatibilities. Even if you don't know, what you are doing you can always trust on it. Unfortunately on Windows the idea of a distribution doesn't exist. In combination with other pointless problems ( like debug/release incompatibilities or this __declspec stuff, what was the reason for the qHash problem ) Windows is by far the most difficult development environment - what can be seen easily from the number of problems reported here.

    Uwe

    PS: Please start a new thread if you want to discuss something different. Nobody will expect to find your hint in a thread about qHash.

Similar Threads

  1. Problem with QAbstractListModel
    By eekhoorn12 in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2009, 14:26
  2. Replies: 1
    Last Post: 23rd April 2009, 09:05
  3. Replies: 19
    Last Post: 3rd April 2009, 23:17
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

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.