undefined reference to `dladdr@GLIBC_2.34'

I am building audacity-sources-3.4.2 in Ubuntu 18.04. And it use conan to build.
I downloaded the source code from here. Following the build instructions from here.

  1. Prerequisites

$ python --version Python 3.9.18 $ cmake --version cmake version 3.27.7 $ g++ --version g++ (Ubuntu 13.1.0-8ubuntu1~18.04) 13.1.0 $ conan --version Conan version 2.0.17 $ sudo apt-get install libgtk2.0-dev libasound2-dev libjack-jackd2-dev uuid-dev Reading package lists… Done Building dependency tree Reading state information… Done libgtk2.0-dev is already the newest version (2.24.32-1ubuntu1). libjack-jackd2-dev is already the newest version (1.9.12~dfsg-2). libasound2-dev is already the newest version (1.1.3-5ubuntu0.6). uuid-dev is already the newest version (2.31.1-0.4ubuntu3.7). 0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.

  1. build
$ mkdir build && cd build
$ cmake -G "Unix Makefiles" ..
$ make

[ 42%] Built target lib-command-parameters
[ 42%] Linking CXX shared library ../../Release/lib/audacity/lib-files.so
[ 42%] Built target lib-files
[ 42%] Linking CXX executable ../../../tests/lib-string-utils-test
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `dladdr@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `dlclose@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `fstat@GLIBC_2.33'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `dlerror@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_mutexattr_init@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_key_create@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_setspecific@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_join@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_mutex_trylock@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `dlsym@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_getspecific@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_key_delete@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `lstat@GLIBC_2.33'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `stat@GLIBC_2.33'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `dlopen@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_mutexattr_settype@GLIBC_2.34'
/home/lili/.conan2/p/wxwid26105d65d2dd5/p/lib/libwx_baseu-3.1.so: undefined reference to `pthread_create@GLIBC_2.34'
collect2: error: ld returned 1 exit status
libraries/lib-string-utils/tests/CMakeFiles/lib-string-utils-test.dir/build.make:115: recipe for target 'tests/lib-string-utils-test' failed
make[2]: *** [tests/lib-string-utils-test] Error 1
CMakeFiles/Makefile2:2265: recipe for target 'libraries/lib-string-utils/tests/CMakeFiles/lib-string-utils-test.dir/all' failed
make[1]: *** [libraries/lib-string-utils/tests/CMakeFiles/lib-string-utils-test.dir/all] Error 2
[ 42%] Linking C static library libsqlite.a
[ 42%] Built target sqlite
[ 43%] Linking CXX executable ../../../tests/lib-utility-test
[ 43%] Built target lib-utility-test
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

my glibc version:

$ ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27

The dependencies are built on a newer system. You can run conan remove "*" add rerun cmake using cmake -Daudacity_conan_allow_prebuilt_binaries=Off .. to force the dependencies to be rebuilt on your system.

I have clear the cache with conan remove “*”. But when I run cmake -Daudacity_conan_allow_prebuilt_binaries=Off … it failed:

Generating host-minsizerel profile...
Traceback (most recent call last):
  File "/home/lili/soft/audacity-sources-3.4.2/conan/conan_runner.py", line 109, in <module>
    subprocess.check_call(conan_options)
  File "/usr/local/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['conan', 'install', '/home/lili/soft/audacity-sources-3.4.2/conan', '--build=missing', '--output-folder', '/home/lili/soft/audacity-sources-3.4.2/build', '--remote', 'audacity-recipes-conan2', '--profile:build', '/home/lili/soft/audacity-sources-3.4.2/build/conan/profiles/build.profile', '--profile:host', '/home/lili/soft/audacity-sources-3.4.2/build/conan/profiles/host-debug.profile']' returned non-zero exit status 1.
CMake Error at cmake-proxies/cmake-modules/AudacityDependencies.cmake:209 (message):
  Conan failed to install dependencies (1) /usr/local/bin/python3.12
Call Stack (most recent call first):
  CMakeLists.txt:579 (include)


-- Configuring incomplete, errors occurred!

I searched a related issue here. It seems this problem is not solved for a year.

This is a different problem. Please post the full CMake output.

it’s the problem of my network. It works now. Thank you.