我目前正在构建一个基于 Qt C++ 框架的项目,该框架利用 Sparkle 框架进行更新。我遇到的问题是我的整个应用程序构建得很好,除非我包含 Sparkle 框架。
Sparkle.framework 目录位于 /Library/Frameworks 目录中。
在我的 .pro 文件中,我有:
QMAKE_LFLAGS += -F /Library/Frameworks
LIBS += -framework Sparkle
在我的 SparkleUpdater 类中,我有以下标题:
#include <Sparkle/Sparkle.h>
#include "SparkleUpdater.h"
当我将鼠标悬停在 Qt Creator 中的包含上时,我会收到关于 sparkle 框架路径的通知,其中包含: /Library/Frameworks/Sparkle.framework/Headers/Sparkle.h 这是正确的位置,实际上是 Sparkle .framework 存在于我的机器上。
然而,当我构建我的项目时,我从编译器中得到以下信息:
SparkleUpdater.mm:2:29: error: Sparkle/Sparkle.h: No such file or directory
SparkleUpdater.mm:10: error: ISO C++ forbids declaration of 'SUUpdater' with no type
SparkleUpdater.mm:10: error: expected ';' before '*' token
SparkleUpdater.mm: In constructor 'SparkleUpdaterPrivate::SparkleUpdaterPrivate()':
SparkleUpdater.mm:9: error: class 'SparkleUpdaterPrivate' does not have any field named 'updater'
SparkleUpdater.mm: In constructor 'SparkleUpdater::SparkleUpdater(const QString&, bool)':
SparkleUpdater.mm:17: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
SparkleUpdater.mm:17: error: 'SUUpdater' was not declared in this scope
SparkleUpdater.mm:18: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
SparkleUpdater.mm:22: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
SparkleUpdater.mm:24: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
SparkleUpdater.mm: In destructor 'virtual SparkleUpdater::~SparkleUpdater()':
SparkleUpdater.mm:30: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
SparkleUpdater.mm: In member function 'virtual void SparkleUpdater::checkForUpdates(bool)':
SparkleUpdater.mm:40: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
SparkleUpdater.mm:41: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
SparkleUpdater.mm:45: error: 'class SparkleUpdaterPrivate' has no member named 'updater'
make[1]: *** [SparkleUpdater.o] Error 1
我已经尝试在我的机器上移除和替换 Sparkle 框架。我尝试过明确地包含 Headers 文件夹:
INCLUDEPATH += -F /Library/Frameworks
和
INCLUDEPATH += -F /Library/Frameworks/Sparkle.framework/Versions/A
而且无济于事。我仍然从编译器得到相同的消息。
谁能帮我?