Menu

#49 Build with -DBUILD_SHARED_LIBS:BOOL=ON fails

closed
nobody
None
5
2012-09-29
2011-09-07
No

$ cmake -DBUILD_SHARED_LIBS:BOOL=ON .
[...]
CMake Error at src/core/CMakeLists.txt:24 (install):
install TARGETS given no LIBRARY DESTINATION for shared library target
"kid3-core".
CMake Error at src/gui/CMakeLists.txt:24 (install):
install TARGETS given no LIBRARY DESTINATION for shared library target
"kid3-gui".

Just a guess, maybe "DESTINATION" should be replaced with "LIBRARY DESTINATION" in these files? Also, ${WITH_BINDIR} sounds suspicious as a location for shared libs, shouldn't it be some library dir, not a bin dir?

Discussion

  • Urs Fleisch

    Urs Fleisch - 2011-09-11

    Thanks for the report. I do not get an error, but the installation location for shared libraries should be different on Linux (I tested it on Windows). Shared libraries are now installed to WITH_LIBDIR with a default of "lib" on Linux. Fixed in Git.

     
  • Juan Luis Baptiste

    The fix on http://kid3.git.sourceforge.net/git/gitweb.cgi?p=kid3/kid3;a=commitdiff;h=ed22f2027b56af1207a936fb7a518e4d68ba3242;hp=638fe80a29bf23feb97276079067d3800fed25d6 doesn't work for me, it still fails with the same error of this bug report. I'm using the following cmake command:

    /usr/bin/cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DCMAKE_BUILD_TYPE=release -DLIB_SUFFIX=64 -DCMAKE_SKIP_RPATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF '-DCMAKE_MODULE_LINKER_FLAGS=-Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags' -DKDE4_ENABLE_FPIE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_DEFAULT_HOME=.kde4 '-DKDE_DISTRIBUTION_TEXT=Mageia release 2 (Cauldron) for x86_64' -DKDE4_USE_ALWAYS_FULL_RPATH=OFF -DKDE4_DATA_DIR=/usr/share/apps -DENABLE_FAM=ON -DPHONON_INCLUDE_DIR=/usr/include -DDBUS_SERVICES_INSTALL_DIR=/usr/share/dbus-1/services -DDBUS_INTERFACES_INSTALL_DIR=/usr/share/dbus-1/interfaces

     
  • Urs Fleisch

    Urs Fleisch - 2011-10-22

    @jbaptiste: Thanks for the report, you are right, building with BUILD_SHARED_LIBS did not work when KDE is enabled. With the small fix at

    http://kid3.git.sourceforge.net/git/gitweb.cgi?p=kid3/kid3;a=commitdiff;h=1a8b4b3a59b7a372bb13d582762b9937356a480b

    you will be able to build the shared libraries.

    Unfortunately, you won't be able to link against these generated shared
    libraries because all symbols are hidden. This is done in the KDE build
    system by setting -fvisibility=hidden and can probably only be
    circumvented by using KDE_EXPORT and KDE_IMPORT macros for all classes
    (see http://techbase.kde.org/Development/Tutorials/Creating_Libraries).
    I hoped to see such crap only on Windows.

    I do not think that it is worth adding all these macros to the classes because these kid3 libraries are not really meant to be used as shared libraries. At the moment, they are only a way to structure the code and manage dependencies. If you know a better way to make the shared libraries work with KDE, please let me know.

     
  • Urs Fleisch

    Urs Fleisch - 2011-10-23

    @jbaptiste:

    If you know a better way to make the shared libraries
    work with KDE, please let me know.

    I found a way how to build the KDE version with shared libraries: Add -D__KDE_HAVE_GCC_VISIBILITY:BOOL=OFF to the cmake options (and you need the patch mentioned in my comment from yesterday).

     
  • Nobody/Anonymous

    Thanks, with latest patch and cmake option everything works. Now we have Mandriva and Mageia packages :)

     
  • Urs Fleisch

    Urs Fleisch - 2011-11-02

    Fixed in version 2.0.1.

     
  • Urs Fleisch

    Urs Fleisch - 2012-05-12

    With Kid3 2.1, the "-D__KDE_HAVE_GCC_VISIBILITY:BOOL=OFF" option is no longer necessary. Building with shared libraries works out of the box.

     
MongoDB Logo MongoDB