1

我有一个静态 Qt 并在 macOS 10.12.4 上重新编译了 qscintilla2_qt5.a (2.10)。当我编译我的项目时,它会打印此错误:

Undefined symbols for architecture x86_64:
  "qRegisterDraggedTypes(QStringList const&)", referenced from:
      initialiseRectangularPasteboardMime() in libqscintilla2_qt5.a(MacPasteboardMime.o)
  "QMacPasteboardMime::count(QMimeData*)", referenced from:
      vtable for RectangularPasteboardMime in libqscintilla2_qt5.a(MacPasteboardMime.o)
  "QMacPasteboardMime::QMacPasteboardMime(char)", referenced from:
      initialiseRectangularPasteboardMime() in libqscintilla2_qt5.a(MacPasteboardMime.o)
  "QMacPasteboardMime::~QMacPasteboardMime()", referenced from:
      RectangularPasteboardMime::~RectangularPasteboardMime() in libqscintilla2_qt5.a(MacPasteboardMime.o)
      RectangularPasteboardMime::~RectangularPasteboardMime() in libqscintilla2_qt5.a(MacPasteboardMime.o)
  "typeinfo for QMacPasteboardMime", referenced from:
      typeinfo for RectangularPasteboardMime in libqscintilla2_qt5.a(MacPasteboardMime.o)
4

1 回答 1

1

当 Qt 静态构建时,需要在 *.pro 文件中添加QT += macextras 。我不知道为什么,但是当程序内置在通常共享的 Qt 中时,它可以在没有这个macextras的情况下工作。

于 2017-05-30T02:00:11.550 回答