Error compiling 2.1.0

I tried to compile 2.1.0 on Linux (Crux) using these commands:

./configure --prefix=/usr --with-libsndfile --with-libmad --with-libid3tag
–with-libflac --with-ffmpeg --with-lame
make

Everything went fine until it came to linking:

audacity-AudioIO.o: In function `AudioIO::StartStream(WaveTrackArray, WaveTrackArray, TimeTrack*, double, double, double, AudioIOListener*, bool, double, double, double const*)':
AudioIO.cpp:(.text+0x76f9): undefined reference to `Resample::Resample(bool, double, double)'
audacity-Mix.o: In function `Mixer::Mixer(int, WaveTrack**, TimeTrack*, double, double, int, int, bool, double, sampleFormat, bool, MixerSpec*)':
Mix.cpp:(.text+0x4f8): undefined reference to `Resample::Resample(bool, double, double)'
Mix.cpp:(.text+0x5a6): undefined reference to `Resample::Resample(bool, double, double)'
audacity-WaveClip.o: In function `WaveClip::Resample(int, ProgressDialog*)':
WaveClip.cpp:(.text+0x42cf): undefined reference to `Resample::Resample(bool, double, double)'
effects/audacity-ChangeSpeed.o: In function `EffectChangeSpeed::ProcessOne(WaveTrack*, long long, long long)':
ChangeSpeed.cpp:(.text+0x5b15): undefined reference to `Resample::Resample(bool, double, double)'
ChangeSpeed.cpp:(.text+0x5bc1): undefined reference to `Resample::Process(double, float*, int, bool, int*, float*, int)'
ChangeSpeed.cpp:(.text+0x5d03): undefined reference to `Resample::~Resample()'
ChangeSpeed.cpp:(.text+0x5e04): undefined reference to `Resample::~Resample()'
prefs/audacity-QualityPrefs.o: In function `QualityPrefs::PopulateOrExchange(ShuttleGui&)':
QualityPrefs.cpp:(.text+0x92e): undefined reference to `Resample::GetFastMethodDefault()'
QualityPrefs.cpp:(.text+0x93a): undefined reference to `Resample::GetFastMethodKey()'
QualityPrefs.cpp:(.text+0xdad): undefined reference to `Resample::GetBestMethodDefault()'
QualityPrefs.cpp:(.text+0xdb9): undefined reference to `Resample::GetBestMethodKey()'
prefs/audacity-QualityPrefs.o: In function `QualityPrefs::GetNamesAndLabels()':
QualityPrefs.cpp:(.text+0x2a9c): undefined reference to `Resample::GetNumMethods()'
QualityPrefs.cpp:(.text+0x2add): undefined reference to `Resample::GetMethodName(int)'
collect2: error: ld returned 1 exit status

It seems that I’m missing a library which wasn’t requested in former versions - but which one?

Thanks for any help,
Bernd

No idea, but you could either try checking out the complete source code then compile Audacity with local libraries wherever possible, or ask the Crux community for help as to whether there is a problem with a system dependency.


Gale

Check to see if there are warning during compile about lib-soxr.

I’m having the same errors at the same place on Ubuntu 12.04. I noticed that, unlike the source for 2.0.6, the 2.1.0 source tree did not include the directory lib-src/libsoxr in the copy I downloaded. Is the source for libsoxr somehow missing?

Incidentally, I had noticed earlier that after ./configure it claimed libsoxr was “disabled” which I thought was odd too.

It is not practical for Audacity to include “all” libraries that it uses. Most of the libraries are standard parts of all Linux distributions, so it would make the Audacity download huge for no real advantage. The Audacity sourcecode does include non-standard libraries and libraries that have been specially patched for Audacity.

At the time of the 2.1.0 release it was thought that libsoxr was standard across most distributions, so it was not included in the tarball. In fact, since then it was discovered that some distributions do not have the development headers for libsoxr - notably “freeBSD”, though I believe that they have now added libsoxr.

For Ubuntu it should not be a problem as Ubuntu includes libsoxr-dev. Just ensure that you have libsoxr, including the “-dev” package installed. Ubuntu should list it as a dependency, but I don’t know if they do.

For Ubuntu 12.04 LTS (which is still a supported version), libsoxr is not available in the repositories. Would it work just to drop the source code from sourceforge into audacity’s lib-src directory if I created a libsoxr directory there for it?

Yes, taking it out was a little premature. Debian Stable only got libsoxr-dev a couple of days ago.

Audacity has just moved over to GitHub GitHub - audacity/audacity: Audio Editor
You can download the current sourcecode from there as a ZIP archive.
I think that you should be able to simply copy the entire /lib-src/libsoxr directory into the /lib-src/ directory of your source tree.
You will need to have cmake installed (it’s required for building linsoxr).

Before rebuilding, run

make distclean

then run configure and make.

Well, I’m getting closer. I ended up compiling libsoxr from source and installing it separately. Then went back to audacity and the configure looked good. Rebuilding it, everything went okay until I tried to execute ./audacity to test it and I got a message that it could not open the libsoxr.so.0 shared object and execution failed. The library is right there in /usr/local/lib so it must be that audacity is looking in the wrong place. Did I need to specify a path to the library when I configured? I didn’t think so, because it looked like it had found it.

Which version of libsoxr did you install?

Did you run sudo ldconfig after installing libsoxr?

Where are you executing ./audacity from? The build folder, or have you installed Audacity and are executing it from there?


Gale

Which version of libsoxr did you install?

I compiled 0.1.1 and then made a deb package using checkinstall and installed it. I did not run ldconfig after installing it.

Where are you executing ./audacity from? The build folder, or have you installed Audacity and are executing it from there?

I executed from the build folder first just to test, and it didn’t work. Then I again built a deb package with checkinstall (which has always worked before for me with audacity) and installed that and got the same error.

Maybe it’s a problem making the packages with checkinstall, but I have a hunch it’s something else. When I looked in the directories, everything appeared to be installed where I expected it to be.

Audacity has just moved over to GitHub > GitHub - audacity/audacity: Audio Editor
You can download the current sourcecode from there as a ZIP archive.
I think that you should be able to simply copy the entire /lib-src/libsoxr directory into the /lib-src/ directory of your source tree.

Okay, so I tried this too, and it was successful. I lifted the libsoxr directory from audacity-master and copied it into audacity-minsrc-2.1.0/lib-src. Everything compiled and it seems to be executing properly … I think …

It’s for another thread most likely, but I noticed that when I execute 2.1.0 from a command line, I can get a global menu with the Ubuntu Unity desktop, but when I execute 2.1.0 using the Ubuntu Dash, the global menu does not work. (2.0.6 on the other hand worked correctly in either case). Maybe it’s something with my system.

You could still try ldconfig.

Unless you need to distribute Audacity or libsoxr, sudo make install would be much simpler.

Gale

It could be your audacity.desktop file. Audacity 2.1.0 ships with src/audacity.desktop.in set to UBUNTU_MENUPROXY=0 which turns off the Unity features in Audacity, but allows keyboard shortcuts to display in the Audacity menus (which they don’t otherwise). So try changing the 0 value to 1.

UnityLaunchersAndDesktopFiles - Community Help Wiki.


Gale

Yes it is simpler, but I also quite like to use CheckInstall because it’s simpler to cleanly uninstall, without needing to keep the original build tree in the home directory. It also provides a bit of a safeguard as it can flag up certain problems before installing and in case the developers have screwed up the uninstall targets (which I have occasionally seen in other applications).

Thanks for the comments. Here is a link to it so anyone interested can read more: CheckInstall .

Gale

It could be your audacity.desktop file. Audacity 2.1.0 ships with src/audacity.desktop.in set to UBUNTU_MENUPROXY=0 which turns off the Unity features in Audacity, but allows keyboard shortcuts to display in the Audacity menus (which they don’t otherwise). So try changing the 0 value to 1.

Thanks for everyone’s help with this thread. I’ve got a working 2.1.0 build now thanks to copying in the libsoxr source from audacity-master, and I’ve been fiddling now with the UBUNTU_MENUPROXY problem, but I think I should start a new thread for that.

Yes it is simpler, but I also quite like to use CheckInstall because it’s simpler to cleanly uninstall, without needing to keep the original build tree in the home directory. It also provides a bit of a safeguard as it can flag up certain problems before installing and in case the developers have screwed up the uninstall targets (which I have occasionally seen in other applications).

BTW… I use checkinstall when I can for the same reasons steve wrote. Cleaner uninstallation-- you don’t have to save the source tree to uninstall later, and if you use a package manager regularly (like synaptic) it shows up as an installed program. Checkinstall works much of the time for quickly building a package, but it will sometimes fail on especially complicated installs.