简体   繁体   English

Phyon在Cygwin上抱怨Qt编译时不支持-fvisibility = hidden

[英]Phonon on Cygwin complains about Qt compiled without support for -fvisibility=hidden

I am trying to use the Phonon library in a test program in Cygwin. 我正在尝试在Cygwin的测试程序中使用Phonon库。

CMake is used for building: CMake用于构建:

find_package(Phonon REQUIRED) find_package(需要Phonon)

But it generates the following error message: 但是会生成以下错误消息:

$ 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)

My test program was already using Qt successfully, and I installed both Qt and Phonon with the cygwin setup program. 我的测试程序已经成功使用了Qt,并且将cygwin安装程序安装了Qt和Phonon。

I tried to compile the test program that is used in Phonon's CMake script: 我试图编译Phonon的CMake脚本中使用的测试程序:

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

And this program does not compile, indeed: 而且该程序实际上不会编译:

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

So what is wrong here? 那么,这里出了什么问题? I would think that if the Cygwin folks provide a package for Phonon, that they would have made sure that it is compatible with their Qt package. 我认为如果Cygwin员工为Phonon提供软件包,他们将确保该软件包与他们的Qt软件包兼容。 The problem only happens on Cygwin, I tried it on my Gentoo machine and it compiles without problems there. 该问题仅在Cygwin上发生,我在我的Gentoo机器上进行了尝试,并且在那里编译时没有问题。

On platforms which do not support ELF visibility attributes, such as Cygwin and Windows, KDE components need to be configured with -D__KDE_HAVE_GCC_VISIBILITY=NO in order to avoid this error. 在不支持ELF可见性属性的平台(例如Cygwin和Windows)上,需要将KDE组件配置为-D__KDE_HAVE_GCC_VISIBILITY=NO ,以避免此错误。 The Cygwin phonon package (as well as the Cygwin Ports KDE packages) are built with cygport, which handles this automatically in kde4_compile . Cygwin声子程序包(以及Cygwin Ports KDE程序包)是使用cygport构建的,该程序可以在kde4_compile中自动处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM