#37 Linking fails: error: --add-needed is not supported

cosmetic
closed
compiling (22)
5
2013-11-26
2012-05-22
Anonymous
No

When compiling 0.8.8, it fails with this linking error:

Linking CXX shared library amplifyfree
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: error: --add-needed is not supported but is required for libkfile.so.4 in /home/michael/dev/kde/kwave/libgui/libkwavegui.so
collect2: ld returned 1 exit status
make[2]: [plugins/codec_ascii/codec_ascii] Error 1
make[1]:
[plugins/codec_ascii/CMakeFiles/plugin_codec_ascii.dir/all] Error 2
make[1]: Waiting for unfinished jobs....
[ 52%] Building CXX object kwave/CMakeFiles/kwave_core.dir/KwaveSplash.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: error: --add-needed is not supported but is required for libkfile.so.4 in /home/michael/dev/kde/kwave/libgui/libkwavegui.so
collect2: ld returned 1 exit status
make[2]:
[plugins/amplifyfree/amplifyfree] Error 1
make[1]: [plugins/amplifyfree/CMakeFiles/plugin_amplifyfree.dir/all] Error 2
[ 53%] Building CXX object kwave/CMakeFiles/kwave_core.dir/MainWidget.o
[ 55%] Building CXX object plugins/about/CMakeFiles/plugin_about.dir/KwaveAboutContainer.o
[ 55%] Building CXX object kwave/CMakeFiles/kwave_core.dir/PlayerToolBar.o
[ 55%] Building CXX object kwave/CMakeFiles/kwave_core.dir/ShortcutWrapper.o
Linking CXX shared library band_pass
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: error: --add-needed is not supported but is required for libkfile.so.4 in /home/michael/dev/kde/kwave/libgui/libkwavegui.so
collect2: ld returned 1 exit status
make[2]:
[plugins/band_pass/band_pass] Error 1
make[1]: [plugins/band_pass/CMakeFiles/plugin_band_pass.dir/all] Error 2
[ 55%] [ 55%] Building CXX object kwave/CMakeFiles/kwave_core.dir/TopWidget.o
Building CXX object plugins/about/CMakeFiles/plugin_about.dir/LogoWidget.o
[ 56%] Building CXX object kwave/CMakeFiles/kwave_core.dir/menus_config_i18n.o
Linking CXX shared library about
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: error: --add-needed is not supported but is required for libkfile.so.4 in /home/michael/dev/kde/kwave/libgui/libkwavegui.so
collect2: ld returned 1 exit status
make[2]:
[plugins/about/about] Error 1
make[1]: [plugins/about/CMakeFiles/plugin_about.dir/all] Error 2
Linking CXX executable kwave
[ 57%] Built target kwave_core
make:
[all] Error 2

After removing that option, everything seems to link and run fine.

Discussion


  • Anonymous
    2012-05-22

    I should note that this error was encountered while using the gold linker, which only supports linking where the required libraries are explicitly defined.

    Since it otherwise compiles fine, all required links are indeed explicitly defined so there should be no issues removing --add-needed.

     
    Last edit: Anonymous 2013-11-26
  • fixed in git, commit ffee1cf0eac985889bc53f27613cea31103514b5

    thanks for reporting!

     
    • status: pending --> closed
    • milestone: --> cosmetic
     
  • fixed in v0.8.9