我试图在Cygwin的测试程序中使用声子库。
CMake用于构建:
Find_package(需要声子)
但是它会生成以下错误消息:
$ 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。
我试图编译用于声子的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的人为声子提供了一个软件包,他们就会确保它与他们的Qt包兼容。这个问题只发生在Cygwin上,我在我的Gentoo机器上试过,它编译时没有问题。
发布于 2014-03-07 05:37:22
在不支持ELF可见性属性(如Cygwin和Windows )的平台上,为了避免此错误,需要使用-D__KDE_HAVE_GCC_VISIBILITY=NO配置KDE组件。Cygwin phonon包(以及Cygwin端口KDE包)是用cygport构建的,它在编译中自动处理。
https://stackoverflow.com/questions/22231945
复制相似问题