【问题标题】:I can't install CTK (The Common Toolkit)我无法安装 CTK(通用工具包)
【发布时间】:2015-08-04 22:42:13
【问题描述】:

我正在尝试安装 CTK,但每次尝试时都会收到此错误:

[ 41%] Built target CTKWidgetsPlugins
Scanning dependencies of target CTKWidgetsCppTests
[ 41%] Building CXX object Libs/Widgets/Testing/Cpp/CMakeFiles/CTKWidgetsCppTests.dir/ctkSearchBoxTest1.cpp.o 

    /home/pedrojunior/Desktop/CTK/Libs/Widgets/Testing/Cpp/ctkSearchBoxTest1.cpp: In function ‘int ctkSearchBoxTest1(int, char**)’:
            /home/pedrojunior/Desktop/CTK/Libs/Widgets/Testing/Cpp/ctkSearchBoxTest1.cpp:43:24: error: ‘QPalette::ColorRole’ is not a class or namespace
p.setColor(QPalette::ColorRole::Window, Qt::gray);
                     ^
            /home/pedrojunior/Desktop/CTK/Libs/Widgets/Testing/Cpp/ctkSearchBoxTest1.cpp:44:24: error: ‘QPalette::ColorRole’ is not a class or namespace
p.setColor(QPalette::ColorRole::Base, Qt::gray);
                     ^
make[5]: *** [Libs/Widgets/Testing/Cpp/CMakeFiles/CTKWidgetsCppTests.dir/ctkSearchBoxTest1.cpp.o] Error 1
make[4]: *** [Libs/Widgets/Testing/Cpp/CMakeFiles/CTKWidgetsCppTests.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [CTK-prefix/src/CTK-stamp/CTK-build] Error 2
make[1]: *** [CMakeFiles/CTK.dir/all] Error 2
make: *** [all] Error 2

我使用的是 Linux Mint 17.1,并且我已经安装了 cmake 版本 2.8.12.2 和 Qt 版本 4.8。 有人知道我该如何解决这个错误吗?

【问题讨论】:

  • 我刚刚检查了CTK out from git 并使用 Qt 4.7.1、CMake 3.0.2 和 GCC 4.8.2 成功构建了它。你的编译器版本是多少?
  • @m.s.该问题的修复程序已于 4 月 30 日 (github.com/commontk/CTK/pull/555) 进入源代码,您将获得修复程序,但 OP 的发行版尚未获取。

标签: qt cmake


【解决方案1】:

QPalette::ColorRole 不是 C++11 枚举类,它只是一个普通的枚举。所以不应该声明ColorRole 部分。

【讨论】:

  • 那么,我应该改变并只留下“QPalette::Window”吗?
  • @PedroPaulo 是的,虽然应该是库维护者来修复他们的代码,但它有一个修复程序:github.com/commontk/CTK/pull/555。但是您的发行版尚未引入最新版本。
猜你喜欢
  • 2010-09-20
  • 2022-01-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-26
  • 2015-06-15
  • 2018-04-26
相关资源
最近更新 更多