Results 1 to 3 of 3

Thread: Compile fail from SVN trunk with VS 2008

  1. #1
    Join Date
    Oct 2007
    Posts
    32
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Compile fail from SVN trunk with VS 2008

    I compile the source from SVN trunk ver 708 with VS 2008 but get some error message

    qwt_slider.cpp
    .\qwt_slider.cpp(782) : error C2668: 'ceil' : ambiguous call to overloaded funct
    ion

    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(549): cou
    ld be 'long double ceil(long double)'
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(501): or
    'float ceil(float)'
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(136): or
    'double ceil(double)'
    while trying to match the argument list '(int)'
    qwt_thermo.cpp
    .\qwt_thermo.cpp(837) : error C2668: 'ceil' : ambiguous call to overloaded funct
    ion
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(549): cou
    ld be 'long double ceil(long double)'
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(501): or
    'float ceil(float)'
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(136): or
    'double ceil(double)'
    while trying to match the argument list '(int)'
    qwt_wheel.cpp
    Generating Code...
    NMAKE : fatal error U1077: 'echo' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
    \nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.

    Seems the issue is coming from function ceil. Please help to solve it. Thanks!

  2. #2
    Join Date
    Jan 2008
    Posts
    56
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compile fail from SVN trunk with VS 2008

    quick fix would be to specify the argument-type explicitely in qwt code, e.g. as taken from my qwt_wheel.cpp (5.2.0)

    Qt Code:
    1. for ( double tickValue = ceil((double)(loValue / tickWidth)) * tickWidth;
    To copy to clipboard, switch view to plain text mode 

    Regards,

    Rainer

  3. #3
    Join Date
    Oct 2007
    Posts
    32
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compile fail from SVN trunk with VS 2008

    Yes, I have a quick fix on two files to solve the compile issue already. Thanks for your help!

    for qwt_slider.cpp, modify line 781, 782

    Qt Code:
    1. const int sdExtent = (int)ceil((double)scaleDraw()->extent( QPen(), font() ));
    2. const int sdLength = (int)ceil((double)scaleDraw()->minLength( QPen(), font() ));
    To copy to clipboard, switch view to plain text mode 
    same for qwt_thermo.cpp, modify line 836, 837

    Qt Code:
    1. const int sdExtent = (int) ceil((double)scaleDraw()->extent( QPen(), font() ));
    2. const int sdLength = (int) ceil((double)scaleDraw()->minLength( QPen(), font() ));
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. VC++ 2008 compile error
    By cutie.monkey in forum Newbie
    Replies: 8
    Last Post: 25th April 2011, 08:44
  2. Replies: 0
    Last Post: 23rd November 2009, 09:48
  3. Fail to compile something rely on Qt4
    By kfc123 in forum Installation and Deployment
    Replies: 1
    Last Post: 2nd July 2009, 20:11
  4. how to compile with msvc express 2008
    By john_god in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd March 2009, 14:09
  5. Qt 4.4.1 Compile Error with MS Visual C++ 2008 Express SP1
    By BrainB0ne in forum Installation and Deployment
    Replies: 3
    Last Post: 19th August 2008, 15:49

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.