我目前正在构建一个基于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"当我将鼠标悬停在include in 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但都是徒劳。我仍然从编译器得到相同的消息。
有谁可以帮我?
发布于 2016-06-22 17:24:15
我最近在Qt中遇到了Sparkle集成的问题。在关注了一些没有帮助的帖子后,我能够弄清楚我需要做些什么才能让事情变得正常。
因此,在此之后,我决定编写一个快速演练,用于启动和运行框架的客户端。你可以在http://www.discoversdk.com/knowledge-base/using-sparkle-in-qt上找到我的帖子
发布于 2012-07-31 20:37:08
这应该可以做到:
cd /Library/Frameworks/Sparkle.framework/Headers
ln -s ../Headers Sparkle
https://stackoverflow.com/questions/11730813
复制相似问题