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
    Oct 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

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

    Hi, I compiled the beta now with MinGW (gcc 4.4) and using a QList<double> inside a Qt project without qwt is no problem.

    Somehow the compiler gets confused at qwt_valuelist.h:48, where a QList<double> is explicitly instantiated for exporting it in the qwt.dll . Uncommenting this line, results in a successful build of qwt with gcc 4.4 and Qt 4.6 beta1.

    Any ideas whats happening there?

    Sascha

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    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)

    Can you compile Qwt 5.2 with Qt 4.5.x and MinGW (gcc 4.4) or is it a problem of the compiler version ?

    Uwe

  3. #3
    Join Date
    Oct 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

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

    I did that on Linux, cross-compiling with MinGW (gcc 4.4) for Windows and it worked, but I will try it on Windows natively in the next days.

    Sascha

  4. #4
    Join Date
    Oct 2009
    Location
    Vilnius, Lithuania
    Posts
    4
    Qt products
    Qt4

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

    Had anybody managed with this? I've looked at qhash.h, and it's rewritten since qt 4.5, and I didn't managed to modify qwt so that it compiles for me
    Last edited by Kazakus; 23rd November 2009 at 07:12.

  5. #5
    Join Date
    Nov 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

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

    Follow to qwt_valuelist.h and change this:

    Qt Code:
    1. #if QT_VERSION < 0x040300
    2. // Some compilers have problems,
    3. // without a qHash(double) implementation
    4. #include <qset.h>
    5. #include <qvector.h>
    6. inline uint qHash(double key) { return uint(key); }
    7. #endif
    To copy to clipboard, switch view to plain text mode 

    to:

    Qt Code:
    1. #if QT_VERSION == 0x040600
    2. // Some compilers have problems,
    3. // without a qHash(double) implementation
    4. #include <qset.h>
    5. #include <qvector.h>
    6. inline uint qHash(double key) { return uint(key); }
    7. #endif
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Oct 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

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

    Hi,

    the hint posted by Indalo does not work for me.

    I am using Qt 4.6 RC now and qwt still doesn't compile without modification. However, changing qwt_valuelist.h:37 from

    Qt Code:
    1. #if defined(QWT_TEMPLATEDLL)
    To copy to clipboard, switch view to plain text mode 

    to

    Qt Code:
    1. #if defined(QWT_TEMPLATEDLL) && QT_VERSION < 0x040600
    To copy to clipboard, switch view to plain text mode 

    works for me.

  7. #7

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

    Hi ,

    i tried all the tricks mentioned above, none worked !
    Any solution ?

    Regards,

  8. #8
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    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

  9. #9

    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,

  10. #10
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    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

  11. #11
    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

  12. #12
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    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

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

    Jore (1st March 2010)

  14. #13
    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

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
  •  
Qt is a trademark of The Qt Company.