gpt4 book ai didi

c++ - 编译时不能包含 Sparkle 框架

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:45:17 25 4
gpt4 key购买 nike

我目前正在构建一个基于 Qt C++ 框架的项目,该项目利用 Sparkle 框架进行更新。我遇到的问题是我的整个应用程序构建得很好,除非我包含了 Sparkle 框架。

Sparkle.framework 目录位于/Library/Frameworks 目录中。

在我的 .pro 文件中我有:

QMAKE_LFLAGS += -F /Library/Frameworks
LIBS += -framework Sparkle

在我的 SparkleUpdater 类中,我有以下 header :

#include <Sparkle/Sparkle.h>
#include "SparkleUpdater.h"

当我将鼠标悬停在 Qt Creator 中的 include 上时,我会收到 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

但无济于事。我仍然从编译器那里收到相同的消息。

谁能帮帮我?

最佳答案

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

所以在这之后我决定编写一个快速演练来启动和运行框架的客户端。你可以在以下位置找到我的帖子:http://www.discoversdk.com/knowledge-base/using-sparkle-in-qt

关于c++ - 编译时不能包含 Sparkle 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11730813/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com