# Linux/debian builds fail

**URL:** <https://forum.juce.com/t/linux-debian-builds-fail/69607>\
**Category:** Audio Plugins\
**Created:** [September 28, 2026, 7:29pm UTC](https://forum.juce.com/t/linux-debian-builds-fail/69607 "2026-09-28T19:29:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arc4thrax](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/arc4thrax/32/22546_2.png) [@arc4thrax](https://forum.juce.com/u/arc4thrax)\
**Post date:** [September 28, 2026, 7:29pm UTC](https://forum.juce.com/t/linux-debian-builds-fail/69607/1 "2026-09-28T19:29:54Z")

</div>

Hi, im trying to build my audio plugin on debian trixie using something like:

```auto
sudo apt install \
  cmake \
  libx11-dev \
  libxrandr-dev \
  libxinerama-dev \
  libxcursor-dev \
  libxft-dev \
  libxi-dev \
  libvorbis-dev \
  libflac-dev \
  juce-modules-source
git clone <my-audio-plugin>
cd <my-audio-plugin>
cmake -B build .
cmake --build build

```

But around 60% I get:

```auto
 60%] Linking CXX executable <audio-plugin>_artefacts/Standalone/<audio-plugin>

/usr/bin/ld: <audio-plugin>_artefacts/lib<audio-plugin>_SharedCode.a(juce_audio_formats.cpp.o): in
 function `juce::FlacReader::FlacReader(juce::InputStream*)':
juce_audio_formats.cpp:(.text._ZN4juce10FlacReaderC2EPNS_11InputStreamE[_ZN4juce10Fl
acReaderC5EPNS_11InputStreamE]+0x9d): undefined reference to `FLAC__stream_decoder_n
ew'
/usr/bin/ld: juce_audio_formats.cpp:(.text._ZN4juce10FlacReaderC2EPNS_11InputStreamE
[_ZN4juce10FlacReaderC5EPNS_11InputStreamE]+0xf6): undefined reference to `FLAC__str
eam_decoder_init_stream'
/usr/bin/ld: juce_audio_formats.cpp:(.text._ZN4juce10FlacReaderC2EPNS_11InputStreamE
[_ZN4juce10FlacReaderC5EPNS_11InputStreamE]+0x12c): undefined reference to `FLAC__st
ream_decoder_process_until_end_of_metadata'

```

Has anybody any clue on why that is? Im not using JUCE as a submodule but rather the `find_package()` function from the [CMake API](https://github.com/juce-framework/JUCE/blob/be29c81492b6151c8ea8d14c840e1311963b3a83/docs/CMake%20API.md#using-find_package).

---

<div class="post-metadata">

**Author:** ![FeRDNYC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ferdnyc/32/7426_2.png) [@FeRDNYC](https://forum.juce.com/u/FeRDNYC)\
**Post date:** [September 28, 2026, 8:38pm UTC](https://forum.juce.com/t/linux-debian-builds-fail/69607/2 "2026-09-28T20:38:06Z")

</div>

The official JUCE distribution comes with a bundled FLAC, but it’s not unlikely the Debian system package unbundles it and expects you to use the system shared FLAC. (Hence your installation of `libflac-dev`.) In which case, you may need to link with FLAC in your CMake configuration.

Assuming Debian’s `libflac-dev` includes CMake CONFIG files, like Fedora’s does, that’d be…

```auto
find_package(FLAC REQUIRED)
target_link_libraries(my_plugin PRIVATE FLAC::FLAC)

```

(Or maybe `FLAC::FLAC++`, but it looks like JUCE uses the C bindings for libflac even though it’s a C++ codebase.)

---

<div class="post-metadata">

**Author:** ![arc4thrax](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/arc4thrax/32/22546_2.png) [@arc4thrax](https://forum.juce.com/u/arc4thrax)\
**Post date:** [September 29, 2026, 3:17pm UTC](https://forum.juce.com/t/linux-debian-builds-fail/69607/3 "2026-09-29T15:17:43Z")

</div>

Thanks!  
Didn’t work on debian because `libflac-dev` doesn’t include said cmake files but works on Arch Linux.

---

<div class="post-metadata">

**Author:** ![FeRDNYC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ferdnyc/32/7426_2.png) [@FeRDNYC](https://forum.juce.com/u/FeRDNYC)\
**Post date:** [September 29, 2026, 3:49pm UTC](https://forum.juce.com/t/linux-debian-builds-fail/69607/4 "2026-09-29T15:49:24Z")

</div>

On Debian you’d want to use the `flac.pc` pkgconfig file that it surely _does_ come bundled with, then. For example..

```cmake
find_package(PkgConfig)
if(PkgConfig_FOUND)
  pkg_check_modules(FLAC flac IMPORTED_TARGET)
endif()
if(NOT TARGET PkgConfig::FLAC)
  message(FATAL_ERROR "libflac is required!")
endif()
target_link_libraries(my_plugin PRIVATE PkgConfig::FLAC)
```
