Important: Please read the Qt Code of Conduct -

Trying to embed QtRpt in my app

  • I 'm trying to embed QtRpt (2.0.0) in my application.
    My first poblem is I can't compile the Demo ( that comes with it.
    I tried with Qt Creator 5.0.2 and 5.2.1.
    With 5.0.2 I get this error:

    ...\qtrptproject 2.0.0\qtrptproject\commonfiles\CommonClasses.h:30: error: C1083: Cannot open include file: 'QtMath': No such file or directory

    The code is this:

    #if QT_VERSION >= 0x50000
        #include <QtMath>
        #include <QtCore/qmath.h>

    With 5.2.1:

    ...\QtRptProject 2.0.0\QtRptProject\CommonFiles\CommonClasses.cpp:920: error: C2668: 'floor' : ambiguous call to overloaded function
    G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(567): could be 'long double floor(long double)'
    G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(519): or       'float floor(float)'
    G:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(136): or       'double floor(double)'
    while trying to match the argument list '(int)'
    ...\QtRptProject 2.0.0\QtRptProject\QtRPT\qtrpt.cpp:758: error: C2143: syntax error : missing ',' before ':'
    and a few more...

    Help!!! :)

  • @Panoss

    QtRpt is not part of Qt but an application using Qt as a toolkit.

    Probably it is better to contact the author QtRpt and consult the documentation provided with the source.

  • I contacted him but he didn't help me at all.

  • Lifetime Qt Champion

    Hi , you should try a newer Qt.
    Seems QtMath was first added in QtCore 5.1

  • Ok, I managed to run it.

    1. I put:
    #if QT_VERSION >= 0x50000
        #include <qmath.h>
        #include <QtCore/qmath.h>
    1. I deleted the content of the function "double2MoneyFrench" in CommonClasses.cpp and just made it return 0.
    2. I commented out this code in CommonClasses.cpp line 758:
    //            for(auto field : fieldObject->crossTab->fieldList) {
    //                drawFields(field,bandTop_,true);
    //            }
    1. I commented out line 537 in CommonClasses.cpp:
     //nWidth = ((int)rint(nHeight * dblAspectRatio)) & -3;
    1. in config.pri I put my project 's debug path in DEST_DIRECTORY variable.

    Thank you guys anyway.

Log in to reply