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

StackOverflow https://stackoverflow.com/questions/22231945

  •  10-06-2023
  •  | 
  •  

Question

I am trying to use the Phonon library in a test program in Cygwin.

CMake is used for building:

find_package(Phonon REQUIRED)

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.

I tried to compile the test program that is used in Phonon's CMake script:

#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. The problem only happens on Cygwin, I tried it on my Gentoo machine and it compiles without problems there.

Était-ce utile?

La solution

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. The Cygwin phonon package (as well as the Cygwin Ports KDE packages) are built with cygport, which handles this automatically in kde4_compile.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top