QtHelp include not found

  • I am getting an error when I @#include <QtHelp>@

    error: @SomeFile.h:9: error: C1083: Cannot open include file: 'QtHelp': No such file or directory@

    My .pro file does contain @QT += help@ and I have also verified the QtHelp4.dll, QtHelp4.lib files exist and the QtHelp include folder exists.

    I have tried cleaning/rebuilding my project.

    Any ideas?


  • Check you qt include path, are /include/QtHelp/QtHelp file exists?
    If yes try:
    @#include <QtHelp/QtHelp>@

  • That works. Why is QtHelp not in the same path as QtCore, QtGui, etc... ?

    Not a big deal now that its working for me but seems a bit strange.

    Thanks again! :)

  • [quote author="mirswith" date="1318313471"]Why is QtHelp not in the same path as QtCore, QtGui, etc... ?[/quote]

    You should always use the module prefix and a specific element include.
    #include <QtGui> // wrong, does include all gui elements
    #include <QPushButton> // wrong, does not use module prefix
    #include <QtGui/QPushButton> // right

  • In that line of thinking should #include <QtHelp> not include all help includes. I do not see this as a 'wrong' way of thinking, the only downside is potential longer compile times vs. a potential large number of #include statements.

  • Yes it should. The test feature is probably missing an INCLUDEPATH statement.

    "-Potential- Definitly longer compile times" is the difference between a coffee-break build and an overnight build (in terms of time and cost). Of course it isn't technically "wrong" - but not everything that is "not that wrong" is necessarily right ;-)

  • Is QtHelp a test feature? Docs say it was introduce in v4.4.

  • No. By feature I mean qmake "configuration features":http://doc.qt.nokia.com/stable/qmake-advanced-usage.html#adding-new-configuration-features found in $QTDIR/mkspecs/features.

    I took a quick look at it and it looks like that the test feature is called testlib, not test. So it is either QT += testlib or CONFIG += test.

    However, do yourself a favor and do not use module wide includes like #include <QtTest>. It is a bad habit and it will strike back at you and you will end up in fixing it somewhen.

Log in to reply

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