# Build error with clang-cl since new ogg headers

**URL:** <https://forum.juce.com/t/build-error-with-clang-cl-since-new-ogg-headers/69537>\
**Category:** General JUCE discussion\
**Created:** [September 16, 2026, 8:22pm UTC](https://forum.juce.com/t/build-error-with-clang-cl-since-new-ogg-headers/69537 "2026-09-16T20:22:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [September 16, 2026, 8:22pm UTC](https://forum.juce.com/t/build-error-with-clang-cl-since-new-ogg-headers/69537/1 "2026-09-16T20:22:26Z")

</div>

Since the libogg/libvorbis/opus update on develop (I’m on 44c149abf), juce\_audio\_formats fails with clang-cl (VS 2026, clang 22, `/std:c++latest`):

```cpp

juce_OggVorbisAudioFormat.cpp(299,24): error : no template named 'unique_ptr' in namespace 'juce::std'; did you mean '::std::unique_ptr'?

juce_OpusAudioFormat.cpp(70,8): error : no template named 'optional' in namespace 'juce::std'; did you mean '::std::optional'?

```

Both files open `namespace juce` first and include the C headers inside it:

```cpp
namespace juce
{
 extern "C"
 {
    #include "ogg/include/ogg/ogg.h"
 }

```

`ogg.h` and `opusenc.h` include `\<stddef.h\>`. clang’s `__stddef_nullptr_t.h` declares `std::nullptr_t` on every include when C++20 is enabled (`__has_feature(modules)` bypasses its guard), and the `_MSC_EXTENSIONS` branch is what clang-cl takes. Included inside the namespace, that creates `juce::std`, which shadows `::std` for the rest of the translation unit. MSVC and the other platforms don’t see it, their headers don’t have the declaration.

Fix: include the ogg, opusfile and opusenc headers before `namespace juce`. The `#if JUCE\_USE\_\*` block is closed before the namespace and reopened inside it, the rest of each file stays as it is.

---

<div class="post-metadata">

**Author:** ![attila](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/attila/32/11206_2.png) [@attila](https://forum.juce.com/u/attila)\
**Post date:** [September 17, 2026, 2:09pm UTC](https://forum.juce.com/t/build-error-with-clang-cl-since-new-ogg-headers/69537/2 "2026-09-17T14:09:08Z")

</div>

Thank you for reporting this. A fix is now out on develop

> <https://github.com/juce-framework/JUCE/commit/6ca2c0f75cdcfdd7adecb8db9e4cbf1eeb0f17d1>
