Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 741969

Summary: media-sound/audacity-2.4.2-r1[-flac] - ld: src/CMakeFiles/Audacity.dir/ondemand/ODDecodeFlacTask.cpp.o: in function `ODFlacDecoder::ReadHeader()': ODDecodeFlacTask.cpp:(.text+0x768): undefined reference to `FLAC::Decoder::File::File()'
Product: Gentoo Linux Reporter: ernsteiswuerfel <erhard_f>
Component: Current packagesAssignee: Professional Audio Applications Maintainers <proaudio>
Severity: normal CC: fordfrog, jstein, kripton,, richard
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Attachments: emerge --info
build.log 2.4.2-r1

Description ernsteiswuerfel archtester 2020-09-12 19:32:36 UTC
Encountered at tatt-testing bug #740054.

All builds with USE='-flac' fail:
USE='-alsa -doc -ffmpeg flac id3tag jack -ladspa -lv2 -mad -ogg oss -portmidi portmixer portsmf -sbsms -twolame -vamp -vorbis -vst' succeeded for =media-sound/audacity-2.4.2-r1
USE='-alsa -doc -ffmpeg -flac id3tag jack -ladspa lv2 mad -ogg oss -portmidi -portmixer portsmf sbsms -twolame -vamp -vorbis -vst' failed for =media-sound/audacity-2.4.2-r1
USE='alsa doc -ffmpeg flac -id3tag -jack ladspa -lv2 mad ogg oss -portmidi portmixer -portsmf -sbsms twolame -vamp -vorbis -vst' succeeded for =media-sound/audacity-2.4.2-r1
USE='-alsa doc -ffmpeg -flac id3tag jack ladspa -lv2 -mad ogg oss -portmidi portmixer -portsmf sbsms -twolame vamp -vorbis -vst' failed for =media-sound/audacity-2.4.2-r1
USE='alsa -doc -ffmpeg flac -id3tag jack ladspa -lv2 -mad -ogg -oss -portmidi -portmixer -portsmf -sbsms twolame vamp -vorbis -vst' succeeded for =media-sound/audacity-2.4.2-r1
USE='alsa -doc ffmpeg flac id3tag -jack ladspa lv2 mad -ogg oss portmidi -portmixer portsmf sbsms twolame vamp vorbis -vst' succeeded for =media-sound/audacity-2.4.2-r1
USE='-alsa doc -ffmpeg -flac id3tag -jack ladspa lv2 mad ogg oss -portmidi portmixer portsmf sbsms twolame -vamp -vorbis vst' failed for =media-sound/audacity-2.4.2-r1
USE='alsa doc ffmpeg flac id3tag jack ladspa -lv2 -mad ogg oss portmidi portmixer portsmf sbsms -twolame -vamp vorbis vst' succeeded for =media-sound/audacity-2.4.2-r1
USE='alsa -doc -ffmpeg -flac id3tag jack ladspa lv2 mad -ogg -oss -portmidi portmixer portsmf -sbsms twolame -vamp vorbis vst' failed for =media-sound/audacity-2.4.2-r1
USE='-alsa -doc -ffmpeg -flac id3tag jack ladspa lv2 mad -ogg oss -portmidi portmixer -portsmf sbsms twolame -vamp vorbis vst' failed for =media-sound/audacity-2.4.2-r1
USE='alsa doc -ffmpeg -flac id3tag -jack ladspa lv2 -mad -ogg -oss -portmidi portmixer portsmf sbsms -twolame vamp vorbis vst' failed for =media-sound/audacity-2.4.2-r1
USE='-alsa doc -ffmpeg -flac -id3tag jack ladspa lv2 mad ogg -oss portmidi -portmixer portsmf sbsms twolame vamp vorbis vst' failed for =media-sound/audacity-2.4.2-r1

/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: src/CMakeFiles/Audacity.dir/ondemand/ODDecodeFlacTask.cpp.o:([_ZTV10ODFLACFile]+0xa0): undefined reference to `FLAC::Decoder::File::init(char const*)'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: src/CMakeFiles/Audacity.dir/ondemand/ODDecodeFlacTask.cpp.o:([_ZTV10ODFLACFile]+0xa4): undefined reference to `FLAC::Decoder::File::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: src/CMakeFiles/Audacity.dir/ondemand/ODDecodeFlacTask.cpp.o:([_ZTV10ODFLACFile]+0xa8): undefined reference to `FLAC::Decoder::File::init_ogg(_IO_FILE*)'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: src/CMakeFiles/Audacity.dir/ondemand/ODDecodeFlacTask.cpp.o:([_ZTV10ODFLACFile]+0xac): undefined reference to `FLAC::Decoder::File::init_ogg(char const*)'
/usr/lib/gcc/powerpc-unknown-linux-gnu/9.3.0/../../../../powerpc-unknown-linux-gnu/bin/ld: src/CMakeFiles/Audacity.dir/ondemand/ODDecodeFlacTask.cpp.o:([_ZTV10ODFLACFile]+0xb0): undefined reference to `FLAC::Decoder::File::init_ogg(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
 * ERROR: media-sound/audacity-2.4.2-r1::gentoo failed (compile phase):
 *   ninja -v -j1 -l0 failed
 * Call stack:
 *, line  125:  Called src_compile
 *   environment, line 2077:  Called cmake_src_compile
 *   environment, line  737:  Called cmake_build
 *   environment, line  706:  Called eninja
 *   environment, line 1161:  Called die
 * The specific snippet of code:
 *       "$@" || die "${nonfatal_args[@]}" "${*} failed"
Comment 1 ernsteiswuerfel archtester 2020-09-12 19:32:58 UTC
Created attachment 659871 [details]
emerge --info
Comment 2 ernsteiswuerfel archtester 2020-09-12 19:33:37 UTC
Created attachment 659874 [details]
Comment 3 Miroslav Ć ulc gentoo-dev 2020-09-13 09:47:13 UTC
it fails when linking on-demand feature of audacity which is claimed to be withdrawn from audacity in 2.3.3+:

anyway, flac use flag is the only use flag that has to be enabled to compile it successfully so it seems it's not optional as of now.

atm i'm not 100% sure making flac lib mandatory is the correct solution, maybe it's an upstream issue.

anyway, thank you for the report. will try to find the appropriate solution to fix it.
Comment 4 Jeffrey Lin 2021-03-02 22:26:50 UTC
Created attachment 689163 [details]
build.log 2.4.2-r1

The issue I hit was:

In file included from /tmp/portage/media-sound/audacity-2.4.2-r1/work/audacity-Audacity-2.4.2/src/ProjectFileManager.cpp:54:
/tmp/portage/media-sound/audacity-2.4.2-r1/work/audacity-Audacity-2.4.2/src/ondemand/ODDecodeFlacTask.h:35:10: fatal error: FLAC++/decoder.h: No such file or directory
   35 | #include "FLAC++/decoder.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
Comment 5 Larry the Git Cow gentoo-dev 2024-04-16 22:57:22 UTC
The bug has been closed via the following commit(s):

commit 72e8c24fcd0beb997a88f7d185a02a212abafe37
Author:     Aliaksei Urbanski <>
AuthorDate: 2024-04-16 19:03:31 +0000
Commit:     Yixun Lan <>
CommitDate: 2024-04-16 22:53:49 +0000

    media-sound/audacity: fix various issues
    The flac USE flag was mistakenly used
    instead of the opus USE flag for configuring.
    Also, Audacity 3.4.2 introduced a brand new
    USE_OPUSFILE option which must be set properly.
    These changes:
      - fix the opus USE flag
      - add proper REQUIRED_USE
      - replace media-sound/mpg123 with media-sound/mpg123-base
      - move dev-libs/rapidjson from RDEPEND to DEPEND
      - fix missing `#include <limits>` for 2.4.2-r4
      - limit media-video/ffmpeg to <5 for 2.4.2-r4
      - add x11-base/xorg-proto to DEPEND
      - add some ASM to BDEPEND
      - add audacity-3.4.2-audiocom-std-string.patch to PATCHES for 3.3.3-r1
      - add audacity-2.4.2-fix-libflac-undefined-references.patch to PATCHES for 2.4.2-r4
      - reset KEYWORDS for 2.4.2-r4 and 3.3.3-r1
    Co-authored-by: Matthew White <>
    Signed-off-by: Aliaksei Urbanski <>
    Signed-off-by: Yixun Lan <>

 media-sound/audacity/audacity-2.4.2-r4.ebuild      | 135 +++++++++++++++++++++
 ...acity-3.3.3.ebuild => audacity-3.3.3-r1.ebuild} |  33 ++---
 ...acity-3.4.2.ebuild => audacity-3.4.2-r1.ebuild} |  24 ++--
 media-sound/audacity/audacity-9999.ebuild          |  24 ++--
 ...audacity-2.4.2-add-missing-include-limits.patch |  10 ++
 ...ty-2.4.2-fix-libflac-undefined-references.patch |  61 ++++++++++
 media-sound/audacity/metadata.xml                  |   4 +-
 7 files changed, 258 insertions(+), 33 deletions(-)