编译时不能包含Sparkle框架

时间:2012-07-30 22:47:43

标签: c++ qt gcc g++ sparkle

我目前正在构建一个基于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中的include上时,我会收到一条闪烁框架路径的通知,其中包含:/ Library / Frame / 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

无济于事。我仍然从编译器得到相同的消息。

任何人都可以帮助我吗?

2 个答案:

答案 0 :(得分:2)

我最近在Qt中遇到了Sparkle集成的问题。在关注了一些没有帮助的帖子后,我能够弄清楚我需要做些什么才能让事情发挥作用。

所以在此之后我决定编写一个快速的步骤来让框架的客户端启动并运行。 您可以在http://www.discoversdk.com/knowledge-base/using-sparkle-in-qt

找到我的帖子

答案 1 :(得分:0)

应该这样做:

cd /Library/Frameworks/Sparkle.framework/Headers

ln -s ../Headers Sparkle

相关问题