Configure Error: "dlopen not found" / Ubutntu 16.04

I’ve been trying to complie Audacity 2.2.1 for a couple of days now, and I keep getting this error.

checking for library containing dlopen... no
configure: error: dlopen not found, required by Audacity

I’ve gone through and made sure that I have all the dependencies installed, and all of the “*-dev” versions of these dependencies, where available. I’ve made the /build directory in the audacity folder (~/audacity-minsrc-2.2.1-rc3), and I’ve run

sudo ../configure CXXFLAGS=”-std=gnu++11″ --with-lib-preference="local system"

.

I’ve also run:

sudo autoreconf --no-recursive -i

followed by

sudo ../configure CXXFLAGS=”-std=gnu++11″ --with-lib-preference="local system"

, but I still get the same error. I’ve also tried running

sudo ../configure CXXFLAGS=”-std=gnu++11″ --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading

I still get the same error; the full log is as follows:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking for C compiler vendor... gnu
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... failed
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
libtool.m4: error: problem compiling CXX test program
checking for g++ option to produce PIC...  -DPIC
checking if g++ PIC flag  -DPIC works... no
checking if g++ static flag  works... no
checking if g++ supports -c -o file.o... no
checking if g++ supports -c -o file.o... (cached) no
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking for pkg-config... yes
checking whether the linker accepts the -rdynamic flag... no
configure: WARNING: "Linker does not support -rdynamic. Could not enable exporting all symbols"
configure: WARNING: "Audacity module support will probably not work"
checking for an ANSI C-conforming const... no
checking for size_t... no
checking for alloca.h... no
checking for libudev.h... no
checking whether we are using gcc 4.9.0 or later... yes
checking CFLAGS for strict prototypes... no, suppressed, signal.h
checking wall_flags for maximum warnings... -Wall
checking whether the C++ compiler accepts the  -Wall flag... no
checking whether the C++ preprocessor accepts the  -Wall flag... yes
checking whether the -Werror option is usable... no
checking for simple visibility declarations... no
checking for wx-config... /usr/local/bin/wx-config
configure: Checking that the chosen version of wxWidgets is 3.0.x
Great, you're using wxWidgets 3.0.3!
configure: Determining what libraries are available in this tree and on the system
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for EXPAT... yes
configure: Expat libraries are available as system libraries
checking for ../lib-src/expat/lib/expat.h... yes
configure: Expat libraries are available in the local tree
checking for AVCODEC... yes
checking for AVFORMAT... yes
checking for AVUTIL... yes
configure: FFmpeg library available as system library
checking for ../lib-src/ffmpeg/libavcodec/avcodec.h... yes
checking for ../lib-src/ffmpeg/libavformat/avformat.h... yes
configure: FFmpeg headers are available in the local tree
checking for lame_set_VBR_q in -lmp3lame... no
checking lame/lame.h usability... no
checking lame/lame.h presence... yes
configure: WARNING: lame/lame.h: present but cannot be compiled
configure: WARNING: lame/lame.h:     check for missing prerequisite headers?
configure: WARNING: lame/lame.h: see the Autoconf documentation
configure: WARNING: lame/lame.h:     section "Present But Cannot Be Compiled"
configure: WARNING: lame/lame.h: proceeding with the compiler's result
checking for lame/lame.h... no
configure: LAME library is NOT available as system library.
checking for ../lib-src/lame/lame/lame.h... yes
configure: LAME headers are available in this source tree.
checking for FLAC... yes
configure: FLAC libraries are available as system libraries
checking for ../lib-src/libflac/include/FLAC/format.h... yes
checking for ../lib-src/libflac/include/FLAC++/decoder.h... yes
configure: FLAC libraries are available in this source tree
checking for ID3TAG... yes
configure: Libid3tag libraries are available as system libraries
checking for ../lib-src/libid3tag/frame.h... yes
configure: libid3tag libraries are available in the local tree
checking for LIBMAD... yes
checking for mad_decoder_init in -lmad... no
configure: WARNING: system installation of libmad found, but it is too old.  Upgrade to at least 0.14.2b to use with Audacity
configure: libmad libraries are available as system libraries
checking for ../lib-src/libmad/frame.h... yes
configure: libmad libraries are available in the local tree
checking for ../lib-src/libnyquist/nyx.h... yes
configure: nyquist libraries are available in the local tree
checking for SBSMS... no
configure: Libsbsms libraries are NOT available as system libraries
checking for ../lib-src/sbsms/include/sbsms.h... yes
configure: libsbsms libraries are available in the local tree
checking for SNDFILE... yes
configure: Libsndfile libraries are available as system libraries
checking for ../lib-src/libsndfile/src/sndfile.h.in... yes
configure: libsndfile libraries are available in this source tree
checking for SOUNDTOUCH... yes
configure: Libsoundtouch libraries are available as system libraries
checking for ../lib-src/soundtouch/include/SoundTouch.h... yes
configure: libsoundtouch libraries are available in the local tree
checking for SOXR... yes
configure: Soxr libraries are available as system libraries
checking for ../lib-src/libsoxr/src/soxr.h... yes
configure: libsoxr libraries are available in the local tree
checking for LIBTWOLAME... yes
configure: Libtwolame library available as system library
checking for ../lib-src/twolame/libtwolame/twolame.h... yes
configure: libtwolame library is available in the local tree
checking for VAMP... yes
configure: Vamp libraries are available as system libraries
checking for ../lib-src/libvamp/vamp-hostsdk/PluginLoader.h... yes
configure: Vamp libraries are available in the local tree
checking for LIBVORBIS... yes
configure: Vorbis libraries are available as system libraries
checking for ../lib-src/libvorbis/include/vorbis/vorbisenc.h... yes
checking for ../lib-src/libogg/include/ogg/ogg.h... yes
configure: Vorbis libraries are available in this source tree
checking for LV2... yes
configure: LV2 libraries are available as system libraries
checking for ../lib-src/lv2/configure... yes
configure: LV2 libraries are available in the local tree
checking for PORTAUDIO... yes
configure: portaudio19 library is available as system library
checking for ../lib-src/portaudio-v19/include/portaudio.h... yes
configure: portaudio19 library is available in the local tree
checking for PORTSMF... yes
configure: portSMF library is available as system library
checking for ../lib-src/portsmf/allegro.h... yes
configure: portSMF library is available in the local tree
checking for PORTMIDI... no
configure: portmidi library is NOT available as system library
checking for ../lib-src/portmidi/pm_common/portmidi.h... yes
configure: portmidi library is available in the local tree
checking for WIDGETEXTRA... no
configure: libwidgetextra library is NOT available as system library.
checking for ../lib-src/lib-widget-extra/NonGuiThread.h... yes
configure: libwidgetextra library is available in the local tree
configure: Figuring out what libraries to enable
configure: Using LOCAL libraries for EXPAT
configure: Using the SYSTEM libraries for FFMPEG because you specifically requested this
configure: Using LOCAL libraries for LAME
configure: Using LOCAL libraries for LIBFLAC
configure: Using LOCAL libraries for LIBID3TAG
configure: Using LOCAL libraries for LIBMAD
configure: Using LOCAL libraries for LIBNYQUIST
configure: Using LOCAL libraries for LIBSBSMS
configure: Using LOCAL libraries for LIBSNDFILE
configure: Using LOCAL libraries for LIBSOUNDTOUCH
configure: Using LOCAL libraries for LIBSOXR
configure: Using LOCAL libraries for LIBTWOLAME
configure: Using LOCAL libraries for LIBVAMP
configure: Using LOCAL libraries for LIBVORBIS
configure: Using LOCAL libraries for LV2
configure: Using LOCAL libraries for PORTAUDIO
configure: Using LOCAL libraries for PORTSMF
configure: Using LOCAL libraries for PORTMIDI
configure: Using LOCAL libraries for WIDGETEXTRA
configure: FFMPEG: adding  to libraries
checking for library containing dlopen... no
configure: error: dlopen not found, required by Audacity

I’ve tried downloading the source from the Audacity GitHub site and from Audacity’s webside itself.

I’m a relative noob when it comes to Linux, so any help you can provide would be greatly appreciated.

Check if libltdl7 is installed.
I’ve never had to install that specifically, so I guess that it is usually pulled in as a dependency of something else. Did you install “build-essential”?

I did install build-essential. I also have libtdl7 and libtdl-dev installed.

FWIW, I had a previous version of Audacity installed–2.1.2 from the Ubuntu distro package. I uninstalled it with “sudo apt remove audacity” prior to trying to compile Audacity 2.2.1.

I use Xubuntu 16.04.
My procedure is like this post with just a few modifications: https://forum.audacityteam.org/t/building-audacity-2-1-2-on-ubuntu-15-10/40680/1

Differences:

  1. Configure Audacity:
../configure --with-lib-preference="local system" --with-ffmpeg="system" --disable-dynamic-loading
  1. Build audacity;
make -j8

Note that I’m building on an 8 core i7. This tells “make” to run jobs on all 8 cores. If your processor has a different number of cores, change the number accordingly.
Without the “j” option, “make” will use a single core (and take much longer to build).

Before running step 6, if step 5 completes correctly, it should be possible to launch Audacity with:

./audacity

Thank you! I had to re-download the source code (I kept getting an error during the make process), but that did the trick.

I don’t think the OP’s problem actually has anything to do with system configuration or installed libraries. The problem is that the “configure” command given on the “download source” page has been mangled to feature “smart” quotes. The Linux command line does not understand smart quotes, so if you copy-paste the command line from the website it will not work. The correct command is

./configure CXXFLAGS="-std=gnu++11"

This looks the same at a casual glance but does not have the smart quotes and should be acceptable to your shell.

I’m posting here although the OP has now managed to build Audacity because this topic came up on a search for the error message. I’ve sent a report to the feedback address.

(It’s quite a common, and very subtle and annoying, problem and not restricted to Linux; see this blog post by Raymond Chen for a more detailed discussion. Technically, the part of the command line that’s got mangled determines the options passed to your C++ compiler. Since the configure script actually tests parts of your system configuration by compiling small C++ programs and checking for errors, a garbled command line that causes the compiler to break will fail the script as soon as it does, and it so happens that the “dlopen” check is the first such check it carries out. Hence the misleading error.)

That has now been fixed.

As a general guide, when compiling software, look in the source code for compilation instructions - those instructions are usually the most up to date.
In the case of Audacity, there are three relevant files, one for each supported platform:

  • Windows: win\compile.txt
  • macOS: mac/Build.txt
  • GNU/Linux: INSTALL