Bug 300426 - __KDE_HAVE_GCC_VISIBILITY not defined on Apple OS X 10.7.4 Lion
Summary: __KDE_HAVE_GCC_VISIBILITY not defined on Apple OS X 10.7.4 Lion
Status: RESOLVED DUPLICATE of bug 300429
Alias: None
Product: buildsystem
Classification: Developer tools
Component: KDE4 (cmake) (show other bugs)
Version: unspecified
Platform: unspecified macOS
: NOR normal
Target Milestone: ---
Assignee: Alexander Neundorf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-22 05:17 UTC by Ian Wadham
Modified: 2012-05-22 06:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Wadham 2012-05-22 05:17:26 UTC
On Apple Macbook Pro with OS X 10.7.4 Lion and XCode 4.2.1, I have installed Macports 2.0.4, kdelibs4 @4.8.2_0, kde4-runtime @4.8.2_0 and qt4-mac @4.7.4_1.  I also have a development version of KDE Games, where I am one of the developers.  Recently I have been unable to compile and link KDE Games, because it gets undefined symbols every time the build tries to link to a library that has just been built.

By reducing the build down to one KDE Games library and one game, I was able to establish that KDE_EXPORT is evaluating to a null string and so is KDEGAMES_EXPORT, which is derived from KDE_EXPORT, consequently no library symbols are made visible.  Looking at <prefix>/include/kdemacros.h, I find that KDE_EXPORT depends on __KDE_HAVE_GCC_VISIBILITY and that macro is not defined (null) in my system.  If I insert a line "add_definitions (-D__KDE_HAVE_GCC_VISIBILITY)" into kdegames/CMakeLists.txt, just after adding KDE4_DEFINITIONS, the build works fine.  So I have a workaround.

I think the problem has arisen because of a recent switch to a different compiler in Macports or XCode.  CMake is using /usr/bin/c++, which is symbolically linked to /usr/bin/llvm-g++-4.2.  Compilation was previously (up till a few weeks ago) using /usr/bin/llvm-cpp-4.2, which gave no problems.

Attached is my CMake output.


Reproducible: Always

Steps to Reproduce:
1. Compile and build KDE Games on Apple Lion using  /usr/bin/llvm-g++-4.2.
2. For further details see above and attached CMake output.
3.
Actual Results:  
Linking CXX executable bomber.app/Contents/MacOS/bomber
Undefined symbols for architecture x86_64:
  "KgThemeProvider::KgThemeProvider(QByteArray const&, QObject*)", referenced from:
      Bomber::Bomber()in bomber.o
      Bomber::Bomber()in bomber.o
  "KgThemeProvider::discoverThemes(QByteArray const&, QString const&, QString const&, QMetaObject const*)", referenced from:
      Bomber::Bomber()in bomber.o
      Bomber::Bomber()in bomber.o


Expected Results:  
No undefined symbols.
Comment 1 Ian Wadham 2012-05-22 06:03:33 UTC

*** This bug has been marked as a duplicate of bug 300429 ***