错误:对“ QFixed”的限定引用是构造函数名称,而不是此上下文中构建Paraview的类型

问题描述 投票:0回答:1

我一直在尝试构建ParaView来测试MacOS上的自定义应用示例here

我已遵循超级构建here的站点说明。

我似乎在Qt部分有问题。

这是我完成的步骤:

$ mkdir pv
$ cd pv
$ git clone https://gitlab.kitware.com/paraview/paraview-superbuild.git
$ cd paraview-superbuild
$ git fetch origin # ensure you have the latest state from the main repo
$ git submodule update

$ cd ..
$ mkdir paraview_build
$ cd paraview_build
$ cmake ../paraview-superbuild
$ ccmake -DCMAKE_OSX_SDK=macosx10.14 ../paraview-superbuild

我启用了CMake变量:

ENABLE_qt5
ENABLE_python
ENABLE_python2

然后跑了:

$ make

我得到的错误:

[ 87%] Performing build step for 'qt5'
Info: creating cache file /Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/.qmake.cache
ld: warning: direct access in function 'QHash<QString, int>::insert(QString const&, int const&)' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::deleteNode2(QHashData::Node*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'QHash<QString, int>::insert(QString const&, int const&)' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::deleteNode2(QHashData::Node*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'QHash<QString, int>::insert(QString const&, int const&)' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::duplicateNode(QHashData::Node*, void*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'QCommandLineParserPrivate::~QCommandLineParserPrivate()' from file '/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/build/qtbase/lib/libQt5Bootstrap.a(qcommandlineparser.o)' to global weak symbol 'QHash<QString, int>::deleteNode2(QHashData::Node*)' from file '.obj/rcc.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../lib/libqtharfbuzz.a(hb-warning.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../lib/libqtharfbuzz.a(hb-warning.o) has no symbols
Makefile:2392: warning: overriding commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPlugin'
Makefile:2024: warning: ignoring old commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPlugin'
Makefile:2396: warning: overriding commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPluginFactory'
Makefile:2020: warning: ignoring old commands for target `../../lib/QtGui.framework/Versions/5/Headers/QGenericPluginFactory'
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/network/access/qnetworkaccessdebugpipebackend_p.h:0: Note: No relevant classes found. No output generated.
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm:833:20: error: qualified reference to 'QFixed' is a constructor name rather than a type in this context
    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
                   ^
1 error generated.
make[7]: *** [.obj/qfontengine_coretext.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[6]: *** [sub-fontdatabases-make_first] Error 2
make[5]: *** [sub-platformsupport-make_first] Error 2
make[5]: *** Waiting for unfinished jobs....
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:868:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
        case QPlatformDialogHelper::HelpRole:
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:865:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
        case QPlatformDialogHelper::NoRole:
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:864:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
        case QPlatformDialogHelper::RejectRole:
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:861:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
        case QPlatformDialogHelper::YesRole:
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/widgets/widgets/qdialogbuttonbox.cpp:860:14: warning: comparison of two values with different enumeration types in switch statement ('QDialogButtonBox::ButtonRole' and 'QPlatformDialogHelper::ButtonRole') [-Wenum-compare-switch]
        case QPlatformDialogHelper::AcceptRole:
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
make[4]: *** [sub-src-make_first] Error 2
make[3]: *** [module-qtbase-make_first] Error 2
CMake Error at /Users/username/Desktop/dev/pv/paraview_build/superbuild/sb-qt5-build.cmake:47 (message):
  Failed with exit code 2


make[2]: *** [superbuild/qt5/stamp/qt5-build] Error 1
make[1]: *** [superbuild/CMakeFiles/qt5.dir/all] Error 2
make: *** [all] Error 2

我该怎么办?

qt cmake paraview
1个回答
0
投票

日志中的错误:

qfontengine_coretext.mm:833:20: error: qualified reference to 'QFixed' is a constructor name rather than a type in this context

是由Qt 5.9.5的已知错误引起的,已记录在here中。那里也有MacOS修复程序,其中涉及修改qfontengine_coretext.mm文件中的一行代码。您的文件位于此处:

/Users/username/Desktop/dev/pv/paraview_build/superbuild/qt5/src/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm

在第833行,从此更改return语句:

QFixed QCoreTextFontEngine::emSquareSize() const
{
    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
}

为此(删除多余的QFixed::,使其不再指定构造函数):

QFixed QCoreTextFontEngine::emSquareSize() const
{
    return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
}

然后,重新运行make以验证更新的源代码已解决此问题。

© www.soinside.com 2019 - 2024. All rights reserved.