gpt4 book ai didi

c++ - Cygwin 上的 Phonon 提示 Qt 编译时不支持 -fvisibility=hidden

转载 作者:行者123 更新时间:2023-11-28 07:02:29 27 4
gpt4 key购买 nike

我正在尝试在 Cygwin 的测试程序中使用 Phonon 库。

CMake 用于构建:

find_package(Phonon REQUIRED)

但它会生成以下错误消息:

$ make
-- Found Qt-Version 4.8.5 (using /usr/bin/qmake-qt4)
-- Found X11: /usr/lib/libX11.dll.a
-- Found Automoc4: /usr/bin/automoc4.exe
CMake Error at /usr/share/phonon/buildsystem/FindPhononInternal.cmake:296 (message):
Qt compiled without support for -fvisibility=hidden. This will break
plugins and linking of some applications. Please fix your Qt installation.
Call Stack (most recent call first):
/usr/lib/cmake/phonon/PhononConfig.cmake:30 (include)
CMakeLists.txt:8 (find_package)

我的测试程序已经成功地使用了 Qt,并且我使用 cygwin 安装程序安装了 Qt 和 Phonon。

我尝试编译在 Phonon 的 CMake 脚本中使用的测试程序:

#include <QtCore/QtGlobal>
int main()
{
#ifndef QT_VISIBILITY_AVAILABLE
#error QT_VISIBILITY_AVAILABLE is not available
#endif
}

而且这个程序确实无法编译:

main.cpp:24:3: error: #error QT_VISIBILITY_AVAILABLE is not available
#error QT_VISIBILITY_AVAILABLE is not available
^

那么这里有什么问题呢?我认为如果 Cygwin 的人为 Phonon 提供一个包,他们会确保它与他们的 Qt 包兼容。这个问题只发生在 Cygwin 上,我在我的 Gentoo 机器上试过了,它在那里编译没有问题。

最佳答案

在不支持 ELF 可见性属性的平台上,例如 Cygwin 和 Windows,KDE 组件需要配置 -D__KDE_HAVE_GCC_VISIBILITY=NO 以避免此错误。 Cygwin 声子包(以及 Cygwin Ports KDE 包)是用 cygport 构建的,它在 kde4_compile 中自动处理这个问题。 .

关于c++ - Cygwin 上的 Phonon 提示 Qt 编译时不支持 -fvisibility=hidden,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22231945/

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