Qt 4.8.4 QtWebKit vs qurl.h



  • Many problems including qurl.h have been previously reported in other contexts. Here's a new one. When I included QtWebKit functionality in my app, qurl.h was required, but produced these errors during project compilation:

    @/usr/include/qt4/QtCore/qurl.h:71:9: error: expected identifier before numeric constant
    /usr/include/qt4/QtCore/qurl.h:71:9: error: expected ‘}’ before numeric constant
    /usr/include/qt4/QtCore/qurl.h:71:9: error: expected unqualified-id before numeric constant
    /usr/include/qt4/QtCore/qurl.h:84:5: error: ‘FormattingOption’ was not declared in this scope
    /usr/include/qt4/QtCore/qurl.h:84:5: error: template argument 1 is invalid
    /usr/include/qt4/QtCore/qurl.h:84:5: error: invalid type in declaration before ‘;’ token
    /usr/include/qt4/QtCore/qurl.h:86:10: error: expected unqualified-id before ‘)’ token
    /usr/include/qt4/QtCore/qurl.h:90:10: error: expected unqualified-id before ‘const’
    /usr/include/qt4/QtCore/qurl.h:90:10: error: expected ‘)’ before ‘const’
    /usr/include/qt4/QtCore/qurl.h:91:10: error: expected unqualified-id before ‘const’
    /usr/include/qt4/QtCore/qurl.h:91:10: error: expected ‘)’ before ‘const’
    /usr/include/qt4/QtCore/qurl.h:93:10: error: expected unqualified-id before ‘const’
    /usr/include/qt4/QtCore/qurl.h:93:10: error: expected ‘)’ before ‘const’@

    ...and so forth.

    My workaround was to hack at qurl.h until the errors disappeared. Does anybody have a fix?



  • [workaround] In enum FormattingOpt the first entry is 'None'. Changing this to 'none' (and replacing subsequent references in qurl.h) fixes the syntax error. Evidently some Qt include file leaves a hanging 'None' definition that conflicts with qurl.h.

    If #include <QUrl> is placed in the application very early, before most if not all other Qt includes, the app compiles OK.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.