Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to symbol 'dlclose@@GLIBC_2.2.5' #105

Closed
nephaste opened this issue Dec 16, 2019 · 8 comments
Closed

undefined reference to symbol 'dlclose@@GLIBC_2.2.5' #105

nephaste opened this issue Dec 16, 2019 · 8 comments

Comments

@nephaste
Copy link

nephaste commented Dec 16, 2019

CMakeError.log
CMakeOutput.log

Hi Noson Team,

try to build Noson for Qnap NAS HDStation (Ubuntu 1804)

after fight with cmake that it takes my QT built in my custom prefix...

it refuses to build noson-cli .. failing with undefined reference to symbol 'dlclose@@GLIBC_2.2.5'

[ 79%] Built target NosonApp_autogen
[ 79%] Generating mpris2_player.cpp, mpris2_player.h
[ 80%] Generating mpris2_root.cpp, mpris2_root.h
[ 81%] Generating mpris2_player.moc
[ 81%] Generating mpris2_root.moc
Scanning dependencies of target NosonApp
make[2]: Warning: File 'backend/NosonApp/CMakeFiles/NosonApp.dir/depend.make' has modification time 2.4 s in the future
[ 82%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/NosonApp_autogen/mocs_compilation.cpp.o
[ 82%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/sonos.cpp.o
[ 83%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/plugin.cpp.o
[ 83%] Linking CXX executable noson-cli
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
backend/cli/CMakeFiles/noson-cli.dir/build.make:91: recipe for target 'backend/cli/noson-cli' failed
make[2]: *** [backend/cli/noson-cli] Error 1
CMakeFiles/Makefile2:723: recipe for target 'backend/cli/CMakeFiles/noson-cli.dir/all' failed
make[1]: *** [backend/cli/CMakeFiles/noson-cli.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 84%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/player.cpp.o
[ 85%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/albumsmodel.cpp.o
[ 86%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/artistsmodel.cpp.o
[ 86%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/genresmodel.cpp.o
[ 87%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/tracksmodel.cpp.o
[ 88%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/queuemodel.cpp.o
[ 88%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/playlistsmodel.cpp.o
[ 89%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/zonesmodel.cpp.o
[ 90%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/renderingmodel.cpp.o
[ 90%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/roomsmodel.cpp.o
[ 91%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/favoritesmodel.cpp.o
[ 92%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/servicesmodel.cpp.o
[ 93%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mediamodel.cpp.o
[ 93%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlfilterbehavior.cpp.o
[ 94%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlsortbehavior.cpp.o
[ 95%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlsortfiltermodel.cpp.o
[ 95%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/allservicesmodel.cpp.o
[ 96%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/alarmsmodel.cpp.o
[ 97%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/composersmodel.cpp.o
[ 98%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/dbus/mpris2.cpp.o
[ 98%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mpris2_root.cpp.o
[ 99%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mpris2_player.cpp.o
[100%] Linking CXX shared module ../qml/NosonApp/libNosonApp.so
make[2]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target NosonApp
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

any idea how to fix it ?

/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

on my search look like a -ldl is missing somewhere...

here is my built : (QT 5.13 is compiled in /opt/Noson)

cmake
-DCMAKE_BUILD_TYPE=release
-DQTROOT=/opt/Noson
-DQt5Core_DIR=/opt/Noson/lib/cmake/Qt5Core
-DQt5DBus_DIR=/opt/Noson/lib/cmake/Qt5DBus
-DQt5Svg_DIR=/opt/Noson/lib/cmake/Qt5Svg
-DQt5Widgets_DIR=/opt/Noson/lib/cmake/Qt5Widgets
-DQt5Xml_DIR=/opt/Noson/lib/cmake/Qt5Xml
-DQt5Gui_DIR=/opt/Noson/lib/cmake/Qt5Gui
-DCMAKE_INSTALL_PREFIX=/opt/Noson ..

openssl version
OpenSSL 1.1.1 11 Sep 2018

@janbar
Copy link
Owner

janbar commented Dec 16, 2019

Seems openssl development headers aren't provided by your platform. Install openssl-dev and it should work I guess.
Also to enable the pulseaudio feature you have to install libpulse-dev.

@nephaste
Copy link
Author

Hi janbar... no luck

openssl-dev do not exist on Ubuntu 18004 .. it is libssl-dev

tried to remove it and reinstall

apt install openssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openssl-dev

apt remove libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done

pt install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done

performed a new built

root@bionic:/SRC/.MYSCRIPT/tmp0/noson-app-4.1.0/build# cmake
-DCMAKE_BUILD_TYPE=release
-DQTROOT=/opt/Noson
-DQt5Core_DIR=/opt/Noson/lib/cmake/Qt5Core
-DQt5DBus_DIR=/opt/Noson/lib/cmake/Qt5DBus
-DQt5Svg_DIR=/opt/Noson/lib/cmake/Qt5Svg
-DQt5Widgets_DIR=/opt/Noson/lib/cmake/Qt5Widgets
-DQt5Xml_DIR=/opt/Noson/lib/cmake/Qt5Xml
-DQt5Gui_DIR=/opt/Noson/lib/cmake/Qt5Gui
-DCMAKE_INSTALL_PREFIX=/opt/Noson ..
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Qt5 version 5.13.2
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Flac: /usr/lib/x86_64-linux-gnu/libFLAC.so
-- Found Flac++: /usr/lib/x86_64-linux-gnu/libFLAC++.so
-- Downloading noson
-- Configuring done
-- Generating done
-- Build files have been written to: /SRC/.MYSCRIPT/tmp0/noson-app-4.1.0/build/backend/lib/noson-download
make: Warning: File 'Makefile' has modification time 4.1 s in the future
make[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 4.1 s in the future
make[2]: Warning: File 'CMakeFiles/noson-download.dir/progress.make' has modification time 4.1 s in the future
Scanning dependencies of target noson-download
make[2]: warning: Clock skew detected. Your build may be incomplete.
make[2]: Warning: File 'CMakeFiles/noson-download.dir/progress.make' has modification time 4.1 s in the future
[ 11%] Creating directories for 'noson-download'
[ 22%] Performing download step (verify and extract) for 'noson-download'
-- verifying file...
file='/SRC/.MYSCRIPT/tmp0/noson-app-4.1.0/backend/lib/noson-2.2.0.tar.gz'
-- verifying file... done
-- extracting...
src='/SRC/.MYSCRIPT/tmp0/noson-app-4.1.0/backend/lib/noson-2.2.0.tar.gz'
dst='/SRC/.MYSCRIPT/tmp0/noson-app-4.1.0/build/backend/lib/noson-src'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 33%] No patch step for 'noson-download'
[ 44%] No skip-update step for 'noson-download'
[ 55%] No configure step for 'noson-download'
[ 66%] No build step for 'noson-download'
[ 77%] No install step for 'noson-download'
[ 88%] No test step for 'noson-download'
[100%] Completed 'noson-download'
make[2]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target noson-download
make[1]: warning: Clock skew detected. Your build may be incomplete.
make: warning: Clock skew detected. Your build may be incomplete.
-- Looking for timegm
-- Looking for timegm - found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Performing Test HAVE_INLINE
-- Performing Test HAVE_INLINE - Success
-- Performing Test HAVE___INLINE
-- Performing Test HAVE___INLINE - Success
-- Performing Test HAVE___INLINE__
-- Performing Test HAVE___INLINE__ - Success
-- Found Pulse: /usr/lib/x86_64-linux-gnu/libpulse.so
-- Found Pulse-simple: /usr/lib/x86_64-linux-gnu/libpulse-simple.so
-- Build noson: /SRC/.MYSCRIPT/tmp0/noson-app-4.1.0/build/backend/lib/noson-build
-- Enable interface MPRIS
-- PlugIns install path: /opt/Noson/lib/noson
-- PlugIns install path: /opt/Noson/lib/noson
-- PlugIns install path: /opt/Noson/lib/noson
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

QTROOT

but problem still persists

Scanning dependencies of target NosonApp
make[2]: Warning: File 'backend/NosonApp/CMakeFiles/NosonApp.dir/depend.make' has modification time 4.1 s in the future
[ 82%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/NosonApp_autogen/mocs_compilation.cpp.o
[ 83%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/plugin.cpp.o
[ 83%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/sonos.cpp.o
[ 83%] Linking CXX executable noson-cli
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
backend/cli/CMakeFiles/noson-cli.dir/build.make:91: recipe for target 'backend/cli/noson-cli' failed
make[2]: *** [backend/cli/noson-cli] Error 1
CMakeFiles/Makefile2:723: recipe for target 'backend/cli/CMakeFiles/noson-cli.dir/all' failed
make[1]: *** [backend/cli/CMakeFiles/noson-cli.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 84%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/player.cpp.o
[ 85%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/albumsmodel.cpp.o
[ 86%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/artistsmodel.cpp.o
[ 86%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/genresmodel.cpp.o
[ 87%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/tracksmodel.cpp.o
[ 88%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/queuemodel.cpp.o
[ 88%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/playlistsmodel.cpp.o
[ 89%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/zonesmodel.cpp.o
[ 90%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/renderingmodel.cpp.o
[ 90%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/roomsmodel.cpp.o
[ 91%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/favoritesmodel.cpp.o
[ 92%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/servicesmodel.cpp.o
[ 93%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mediamodel.cpp.o
[ 93%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlfilterbehavior.cpp.o
[ 94%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlsortbehavior.cpp.o
[ 95%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlsortfiltermodel.cpp.o
[ 95%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/allservicesmodel.cpp.o
[ 96%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/alarmsmodel.cpp.o
[ 97%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/composersmodel.cpp.o
[ 98%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/dbus/mpris2.cpp.o
[ 98%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mpris2_root.cpp.o
[ 99%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mpris2_player.cpp.o
[100%] Linking CXX shared module ../qml/NosonApp/libNosonApp.so
make[2]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target NosonApp
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

can it be linked to the erroe reported in CMakeError about pthread

CMakeFiles/cmTC_0c9e8.dir/src.c.o: In function main': src.c:(.text+0x3e): undefined reference to pthread_create'
src.c:(.text+0x4a): undefined reference to pthread_detach' src.c:(.text+0x5b): undefined reference to pthread_join'
src.c:(.text+0x6f): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status

CMakeCache.txt
CMakeError.log
CMakeOutput.log

@nephaste
Copy link
Author

interesting when i add this flag : -DCMAKE_HAVE_LIBC_PTHREAD=False

/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_a5331.dir/CheckFunctionExists.c.o -o cmTC_a5331 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status

and in CMakeCache

//Dependencies for the target
noson_LIB_DEPENDS:STATIC=general;-lpthread;general;/usr/lib/x86_64-linux-gnu/libz.so;general;/usr/local/lib/libssl.a;general;/usr/local/lib/libcrypto.a;general;/usr/lib/x86_64-linux-gnu/libFLAC++.so;general;/usr/lib/x86_64-linux-gnu/libFLAC.so;general;/usr/lib/x86_64-linux-gnu/libpulse-simple.so;general;/usr/lib/x86_64-linux-gnu/libpulse.so;general;m;general;rt;

seems cross link to -lpthread and not lpthreads ...

typo error maybe ?

@nephaste
Copy link
Author

when i set : -DCMAKE_HAVE_LIBC_PTHREAD=True

error changed :

[ 82%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/sonos.cpp.o
[ 83%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/plugin.cpp.o
[ 83%] Linking CXX executable noson-cli
/usr/bin/ld: /usr/local/lib/libcrypto.a(threads_pthread.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
backend/cli/CMakeFiles/noson-cli.dir/build.make:91: recipe for target 'backend/cli/noson-cli' failed
make[2]: *** [backend/cli/noson-cli] Error 1
CMakeFiles/Makefile2:723: recipe for target 'backend/cli/CMakeFiles/noson-cli.dir/all' failed
make[1]: *** [backend/cli/CMakeFiles/noson-cli.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 84%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/player.cpp.o
[ 85%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/albumsmodel.cpp.o
[ 86%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/artistsmodel.cpp.o
[ 86%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/genresmodel.cpp.o
[ 87%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/tracksmodel.cpp.o
[ 88%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/queuemodel.cpp.o
[ 88%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/playlistsmodel.cpp.o
[ 89%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/zonesmodel.cpp.o
[ 90%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/renderingmodel.cpp.o
[ 90%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/roomsmodel.cpp.o
[ 91%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/favoritesmodel.cpp.o
[ 92%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/servicesmodel.cpp.o
[ 93%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mediamodel.cpp.o
[ 93%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlfilterbehavior.cpp.o
[ 94%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlsortbehavior.cpp.o
[ 95%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/qmlsortfiltermodel.cpp.o
[ 95%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/allservicesmodel.cpp.o
[ 96%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/alarmsmodel.cpp.o
[ 97%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/composersmodel.cpp.o
[ 98%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/dbus/mpris2.cpp.o
[ 98%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mpris2_root.cpp.o
[ 99%] Building CXX object backend/NosonApp/CMakeFiles/NosonApp.dir/mpris2_player.cpp.o
[100%] Linking CXX shared module ../qml/NosonApp/libNosonApp.so
make[2]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target NosonApp
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@nephaste
Copy link
Author

found somethin strange in generated CMakeCache.txt

_OPENSSL_STATIC_LDFLAGS:INTERNAL=-L/usr/local/lib;-lssl;-lcrypto;-lz;-ldl;-pthread
_OPENSSL_STATIC_LDFLAGS_OTHER:INTERNAL=-pthread

it souldnt be -lpthread instead -pthread ? i have no clue how to fix it in CMakeList to have a try

@janbar
Copy link
Owner

janbar commented Dec 17, 2019

I think your system contains invalid libraries (probably stored in /usr/local/lib). You should initiate a cleanup to succeeded a build. About Theads the cmake package name is called "Threads", so this isn't an error or a typo, and the linker arg contains the name of the libs existting in your system (could be thread (posix) , or Threads (windows) or what ever your system has).

@nephaste
Copy link
Author

thanks janbar for your comments...

I will try to build a new Bionic Ubuntu in the day to check....

@nephaste
Copy link
Author

thanks Janbar, its build with a minimal Bionic LXC container
dont know what could happen to my other container very strange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants