With juce 9 windows using clang and ninja give error mingw not support. how can compile?

Hi
Wy i can not use clang and ninja or not use ninja to compile on windows ?. i see in source there are many places that check for mingw and stop compile. I do not want microsoft compiler because clang is much faster. i test juce 7 and clang this give no mingw not support, but clang give error when compile juce audioplugin example.

so what can do ?. i use cmake and visual code and i set the compiler set correct. i can choose between GCC 16.x and clang newest. with GCC and juce 7 i can compile and standalone run but vst 3 create not run.

plugin allow scaling setting from 95% - 200% or use system scaling. the strange thing is also when use the free to download sessionwire input it give noise. it is not digital noise. there seem something play a 2 sec sample with noise. it is not so loud, with music play this mostly not hear.

Does it not work because i have no juce license ?

You can use Clang and Ninja on Windows. The problem is which Clang. JUCE doesn’t support the MinGW toolchain at all. juce_TargetPlatform.h has #ifdef __MINGW32__ #error "MinGW is not supported...", and any Clang that targets x86_64-w64-windows-gnu (MSYS2/MinGW clang, or the clang that ships with GCC distros) defines __MINGW32__. That’s the error you’re hitting, and it’s also why the GCC build gives you a broken VST3.

What you want is Clang with the MSVC ABI, which means clang-cl. It ships with Visual Studio (“C++ Clang tools for Windows” in the installer), or you can use an official LLVM release. You still need the Windows SDK and the MSVC STL, but cl.exe never runs. The Build Tools package is enough, so you don’t need the full IDE.

From an “x64 Native Tools Command Prompt” (or after running vcvars64.bat):

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
cmake --build build

In VS Code with CMake Tools, pick the “Clang … (MSVC CLI) x86_64-pc-windows-msvc” kit, not a MinGW/GNU one. Delete the build folder first, because CMake caches the compiler.

And no, this has nothing to do with having a JUCE licence.

1 Like

the compiler work ok now, but the rC resource builder not . error come : i use juce 7 security fix
…
Program Files (x86)/Microsoft Visual Studio/18/BuildTools/VC/Tools/Llvm/x64/bin/clang-cl.exe" rc /nologo -D_DEBUG /fo CMakeFiles\AudioPluginExample_rc_lib.dir\AudioPluginExample_artefacts\JuceLibraryCode\AudioPluginExample_resources.rc.res C:\msys64\home\AudioPlugin\build\AudioPluginExample_artefacts\JuceLibraryCode\AudioPluginExample_resources.rc

[build] Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

[build] Copyright (C) Microsoft Corporation. All rights reserved.

[build]

[build] fatal error RC1107: invalid usage; use RC /? for Help

[build] [40/64 46% :: 10.333] Building CXX object CMakeFiles\AudioPluginExample_Standalone.
…
in the cmakelists add this lines
NEEDS_STORE_VERSION_INFO FALSE
NEEDS_BASH_ICON FALSE
in hope juce did not start rc
whats can be wrong ?

I tried JUCE 9. The compiler worked, but JUCE tried to do a headless build and caused errors because it compiled in headless mode. The plugin should also add VST3 plugins and should use a GUI. In the Makefile, this is:

set(JUCE_HEADLESS FALSE CACHE BOOL “Disable headless mode” FORCE)

CMakeLists.zip (3.2 KB)

How did you build juceaide ?. I test it with hello world and juce 9, the problem is juceaide is not create automatic and there come no usefull error message from juce build system. I can switch to build juceaide but with clang compiler build of juceaide fail with errors.

Is there a way that i can give juce a filepath to home/tools/juceaide.exe in cmake so it have juceaide.exe always and no delete of build dir can remove it ?

What is the error message?

It wold be useful to see the exact commands you’re running and the exact output they give.

the error ist that rc fail. this is from juce 9 and the hello world example from juce. i rmeove the space in word, so it is not a windows space problem
```
[main] Building folder: c:/msys64/home/helloworld/build

[build] Starting build

[proc] Executing command: C:\msys64\ucrt64\bin\cmake.exe --build c:/msys64/home/helloworld/build --config Debug --target helloworld -j12 -j 12 –

[build] MSBuild-Version 18.11.1-1.26513.3+940033be3 für .NET Framework

[build]

[build] Checking File Globs

[build] 1>Checking Build System

[build] Generating helloworld_artefacts/JuceLibraryCode/helloworld_resources.rc

[build] C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Der benutzerdefinierte Build für “C:\msys64\home\helloworld\build\CMakeFiles\63a14ff0bc204667a6d2d8a36bf0104d\helloworld_resources.rc.rule;C:\msys64\home\helloworld\CMakeLists.txt” wurde mit dem Code -1073741511 beendet. [C:\msys64\home\helloworld\build\helloworld_rc_lib.vcxproj]

[proc] The command: C:\msys64\ucrt64\bin\cmake.exe --build c:/msys64/home/helloworld/build --config Debug --target helloworld -j12 -j 12 – exited with code: 1

[driver] Build completed: 00:00:00.869

[build] Build finished with exit code 1

I also add log output in juceutils.cmake at 890 line

```
if (TARGET juce::juceaide)

    get_target_property(REAL_JUCEAIDE_PATH juce::juceaide IMPORTED_LOCATION_DEBUG)

    if (NOT REAL_JUCEAIDE_PATH)

        get_target_property(REAL_JUCEAIDE_PATH juce::juceaide LOCATION)

    endif()

else()

    set(REAL_JUCEAIDE_PATH "TARGET juce::juceaide NOT FOUND IN MEMORY!")

endif()



message(STATUS "------------------------------------------------------------")

message(STATUS "\[JUCE 9 DEBUG\] Resource Rule System Diagnostics:")

message(STATUS "  -> TARGET LOOKUP: Checked in CMake memory")

message(STATUS "  -> RESOLVED PATH: ${REAL_JUCEAIDE_PATH}")

message(STATUS "  -> INPUT BINARY:  ${input_info_file}")
 message(STATUS "  -> OUTPUT RC:     ${resource_rc_file}")   
 message(STATUS "------------------------------------------------------------")

```
[cmake] – [JUCE 9 DEBUG] Resource Rule System Diagnostics:

[cmake] – → TARGET LOOKUP: Checked in CMake memory

[cmake] – → RESOLVED PATH: juce::juceaide-NOTFOUND

[cmake] – → INPUT BINARY: C:/msys64/home/helloworld/build/helloworld_artefacts/JuceLibraryCode/Info.txt

[cmake] – → OUTPUT RC: C:/msys64/home/helloworld/build/helloworld_artefacts/JuceLibraryCode/helloworld_resources.rc

later during compile no juceaide is create, so the resource error come

before post error was juce 7 and a larger project. this is error in simple hello world on juce 9

and btw . how can i avoid that this forum post a empty line between past text from windows ?. AI tell i should use this ``` but not work

This looks like you’re still running in the mingw environment.

You might have better luck using the Visual Studio generator and building from the IDE itself so you know you’re in the right environment.

If you’re not already, to use Ninja + clang-cl you need to run cmake from the developer command prompt, IIRC.

I have my files in this folder. but it look as correct compiler.
Executing command: C:\msys64\ucrt64\bin\cmake.exe -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE “-DCMAKE_C_COMPILER:FILEPATH=C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.exe” “-DCMAKE_CXX_COMPILER:FILEPATH=C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\Llvm\x64\bin\clang-cl.exe” -T ClangCL,host=x64 -A x64 -Wno-unused-cli -S C:/msys64/home/helloworld -B c:/msys64/home/helloworld/build -G “Visual Studio 18 2026”

[cmake] – Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.26300.

[cmake] – Configuring done (6.5s)

[cmake] – Generating done (0.4s)

[cmake] – Build files have been written to: C:/msys64/home/helloworld/build