开发者

Qt Interface: undefined interface error

I'm trying to write a plugin for KDevelop and I'm having an开发者_C百科 interface problem. Whenever I include QInterfaces(KDevelop::"Interface" I get an undefined interface error when doing the MOC step. Any ideas what going on? This also happens if I compile one of the kdevelop plugins as a single entity that was packaged with the kdevelop source code. I must be missing some linker option or library or something. Any ideas?


Occurred to me that I've got "Error: Undefined interface" from moc regarding file that was targeted towards multiple Qt versions.

#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#else
#include <QDesignerCustomWidgetInterface>
#endif

The outcome was that C++ precompiler manages to evaluate QT_VERSION_CHECK macro, but moc does NOT. You need to re-phrase condition as direct version number

#if (QT_VERSION >= 0x050500)

this way C++ and moc can do the job and includes the file


Using Intellisense in VS 2010 when installing QVTK I get to the source of the error undefined interface: There is a reference to an include file which does not have the correct path set. Check all libraries includes that the path set is correct.


i get error: Undefined interface from MOC when an include file is missing

// folder/subfolder/somewidget.h

#include "subfolder/someinterface.h" // (not found)

class SomeWidget : public ISomeInterface
{
    Q_OBJECT
    Q_INTERFACES(ISomeInterface) // error: Undefined interface

fixed by adding

# CMakeLists.txt

include_directories(folder)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜