Building JUCE but failing

So let me first caveat this by saying, I’m not a coder, I’m a hardware engineer who can ‘hack code’
However I’m working with someone who is a coder and using JUCE.
I’m struggling to get the JUCE app to compile for the elkOS on the raspberry pi. I am using a virtualbox ubuntu machine to do the compiling (it just takes forever on the pi)

I’m following this guide - https://elk-audio.github.io/elk-docs/html/documents/building_plugins_for_elk.html#vst-2-x-plugins-using-juce

I’ve installed the elkOS dev kit, built ProJucer from the elk fork, installed the VST 24 SDK (yes agreement is in place) and I can open a test app (simple sinewave) in ProJucer and then ‘save’ it to create the make files. This where things go wrong.

I’ve followed the section under making the app for the pi and done these -

$ unset LD_LIBRARY_PATH
$ source /opt/elk/1.0/environment-setup-cortexa7t2hf-neon-vfpv4-elk-linux-gnueabi

all good…

next I do;

$ make AR=arm-elk-linux-gnueabi-ar make -jnproc CONFIG=Release CFLAGS="-DJUCE_HEADLESS_PLUGIN_CLIENT=1" TARGET_ARCH="-mcpu=cortex-a53 -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard"

But, what I get is erors;

Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing x11.pc' to the PKG_CONFIG_PATH environment variable No package 'x11' found Package xinerama was not found in the pkg-config search path. Perhaps you should add the directory containing xinerama.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘xinerama’ found
Package xext was not found in the pkg-config search path.
Perhaps you should add the directory containing xext.pc' to the PKG_CONFIG_PATH environment variable No package 'xext' found Package webkit2gtk-4.0 was not found in the pkg-config search path. Perhaps you should add the directory containing webkit2gtk-4.0.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘webkit2gtk-4.0’ found
Package gtk±x11-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk±x11-3.0.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘gtk±x11-3.0’ found
make: *** No rule to make target ‘make’. Stop.

now, I thought this was to build a headless version? so I’m baffled why the makefile is referencing a bunch of X11 bits (here’s the content of the make file)

JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DDEBUG=1 -D_DEBUG=1 -DJUCER_LINUX_MAKE_6D53C8B4=1 -DJUCE_APP_VERSION=1.0.0 -DJUCE_APP_VERSION_HEX=0x10000 $(shell pkg-config --cflags alsa x11 xinerama xext freet
ype2 webkit2gtk-4.0 gtk±x11-3.0 libcurl) -pthread -I…/…/JuceLibraryCode -I/home/paula/repository/JUCE/modules $(CPPFLAGS)

I appreciate I’m probably doing something daft on my way through this process, so please be gentle.

Many thanks in advance
Paula

Hi @Paula,
seems from the build log that you are using a “standard” JUCE version instead than our fork for headless builds:

Is this the case? Otherwise, make sure that you have exported the project in Projucer following the suggested steps (remove OpenGL, Web Browser etc.)

Hi @Stefano, thanks for replying.
I just double checked and I built ProJucer from here - https://github.com/elk-audio/JUCE
the global paths all point to the modules, etc directories inside that.

I’ve done a recompile, same errors.

This time I’ve removed the Juce_OpenGL

Now down to three errors;

Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing x11.pc' to the PKG_CONFIG_PATH environment variable No package 'x11' found Package xinerama was not found in the pkg-config search path. Perhaps you should add the directory containing xinerama.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘xinerama’ found
Package xext was not found in the pkg-config search path.
Perhaps you should add the directory containing `xext.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘xext’ found
make: *** No rule to make target ‘make’. Stop.

So, I think I’m winning…
There is a module called “Juce_Graphics”, but if I remove that a number of things complain :frowning: So I’ll have to speak with my coding partner.

Ensure in Juce that copy mode was not set for all modules - if it is and you used a previous version of juce it is still referencing the old, non Elk modules

Thanks, I just looked, and it’s not checked for any of the modules…
image

I’m pretty sure it’s down to the juce_graphics module, will get my coding partner to resolve that.

juce_graphics should not be an issue since it is the one that we custom patch in the fork.

I suspect there’s some other module that brings in the X11 dependency in your case. Is it possible for you to share the Projucer file so we can take a look?

Here’s the contents of the file.

<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="rWldC2" name="MylaTest" projectType="guiapp" jucerVersion="5.4.5">
  <MAINGROUP id="CANtPr" name="MylaTest">
    <GROUP id="{1881449F-1265-EB47-5598-FBA95F759634}" name="Source">
      <FILE id="C5PLki" name="MainComponent.h" compile="0" resource="0" file="Source/MainComponent.h"/>
      <FILE id="kczENB" name="MainComponent.cpp" compile="1" resource="0"
            file="Source/MainComponent.cpp"/>
      <FILE id="TzfbQ0" name="Main.cpp" compile="1" resource="0" file="Source/Main.cpp"/>
    </GROUP>
  </MAINGROUP>
  <EXPORTFORMATS>
    <XCODE_MAC targetFolder="Builds/MacOSX">
      <CONFIGURATIONS>
        <CONFIGURATION isDebug="1" name="Debug"/>
        <CONFIGURATION isDebug="0" name="Release"/>
      </CONFIGURATIONS>
      <MODULEPATHS>
        <MODULEPATH id="juce_audio_basics" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_devices" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_formats" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_processors" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_utils" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_core" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_cryptography" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_data_structures" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_events" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_graphics" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_gui_basics" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_gui_extra" path="../../SDKs/JUCE/modules"/>
      </MODULEPATHS>
    </XCODE_MAC>
    <LINUX_MAKE targetFolder="Builds/LinuxMakefile">
      <CONFIGURATIONS>
        <CONFIGURATION isDebug="1" name="Debug"/>
        <CONFIGURATION isDebug="0" name="Release"/>
      </CONFIGURATIONS>
      <MODULEPATHS>
        <MODULEPATH id="juce_audio_basics" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_devices" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_formats" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_processors" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_audio_utils" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_core" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_cryptography" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_data_structures" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_events" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_graphics" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_gui_basics" path="../../SDKs/JUCE/modules"/>
        <MODULEPATH id="juce_gui_extra" path="../../SDKs/JUCE/modules"/>
      </MODULEPATHS>
    </LINUX_MAKE>
  </EXPORTFORMATS>
  <MODULES>
    <MODULE id="juce_audio_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_audio_devices" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_audio_formats" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_audio_processors" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_audio_utils" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_cryptography" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
    <MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
  </MODULES>
  <LIVE_SETTINGS>
    <OSX/>
    <LINUX/>
  </LIVE_SETTINGS>
  <JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1" JUCE_WEB_BROWSER="0"/>
</JUCERPROJECT>

it produces a sinewave, nothing more yet.
And we’re building on Linux.

Ah,
the culprit here might be juce_gui_extra, try to remove that because there’s a high chance that it’s not used by your project.

Sadly, looks like two modules have dependencies :frowning:
image

I followed all the instructions at elkpi-sdk-master in running_docker_container_on_macos.md. I got the JUCE fork from elk-audio/JUCE. I compiled the Xcode project then the app. I run the app, about reports v5.4.5. I checked out elk-audio/elk-examples. I double checked all the settings required. In addition to that, I unchecked Create Local Copy as suggested above in this post.

I went to Docker Quickstart Terminal and opened window. I followed all instructions for MacOs. When I connect in finder via Samba the Guest credentials did not work. I copied the project files to the docker container however like this:
docker cp foo.txt mycontainer:/foo.txt
docker cp mycontainer:/foo.txt foo.txt

After copying the JUCE source files to the docker container, going to the linux build folder, I get these errors when entering make:

sdkuser@85fb9c80a5be:/workdir/code/elk_juce_example/Builds/LinuxMakefile$ make
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Package xinerama was not found in the pkg-config search path.
Perhaps you should add the directory containing `xinerama.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xinerama' found
Package xext was not found in the pkg-config search path.
Perhaps you should add the directory containing `xext.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xext' found
Compiling include_juce_audio_plugin_client_VST2.cpp
**arm-elk-linux-gnueabi-g++:** **error:** unrecognized -march target: native
**arm-elk-linux-gnueabi-g++:** **note:** valid arguments are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5t armv5e armv5te armv5tej armv6 armv6j armv6k armv6z armv6kz armv6zk armv6t2 armv6-m armv6s-m armv7 armv7-a armv7ve armv7-r armv7-m armv7e-m armv8-a armv8.1-a armv8.2-a armv8.3-a armv8.4-a armv8-m.base armv8-m.main armv8-r iwmmxt iwmmxt2
**arm-elk-linux-gnueabi-g++:** **error:** missing argument to ‘ **-march=** ’
Makefile:151: recipe for target 'build/intermediate/Debug/include_juce_audio_plugin_client_VST2_dd551e08.o' failed
make: *** [build/intermediate/Debug/include_juce_audio_plugin_client_VST2_dd551e08.o] Error 1

If I compile with the instructions shown here, I get:

sdkuser@669c56454d73:/workdir/code/elk_juce_example/Builds/LinuxMakefile$ AR=arm-elk-linux-gnueabi-ar make -j`nproc` CONFIG=Release CFLAGS="-DJUCE_HEADLESS_PLUGIN_CLIENT=1" TARGET_ARCH="-mcpu=cortex-a53 -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard"
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
Package xinerama was not found in the pkg-config search path.
Perhaps you should add the directory containing `xinerama.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xinerama' found
Package xext was not found in the pkg-config search path.
Perhaps you should add the directory containing `xext.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xext' found
Compiling include_juce_audio_plugin_client_VST2.cpp
In file included from **../../JuceLibraryCode/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:36** ,
from **../../JuceLibraryCode/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST2.cpp:27** ,
from **../../JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp:9** :
**../../JuceLibraryCode/modules/juce_audio_plugin_client/VST/../utility/juce_IncludeSystemHeaders.h:44:11:** **fatal error:** X11/Xlib.h: No such file or directory
#include **<X11/Xlib.h>**
**^~~~~~~~~~~~**
compilation terminated.
Makefile:151: recipe for target 'build/intermediate/Release/include_juce_audio_plugin_client_VST2_dd551e08.o' failed
make: *** [build/intermediate/Release/include_juce_audio_plugin_client_VST2_dd551e08.o] Error 1
sdkuser@669c56454d73:/workdir/code/elk_juce_example/Builds/LinuxMakefile$

Things I will try: compile on the ElkPi board, try a VST3 without JUCE.

Any idea how to resolve this? Thanks!

I think you compile with the -i flag which will ignore the x11 errors. I use the following for debug builds:

AR=arm-elk-linux-gnueabi-ar make -i -j`nproc` CONFIG=Debug CFLAGS="-DJUCE_HEADLESS_PLUGIN_CLIENT=1" TARGET_ARCH="-march=armv8-a -mtune=cortex-a72"

( I think your arch is different, but simply try adding the -i)

1 Like

Hi @toani,
have you checked that you are using the mind/headless_plugin_client-next branch in the JUCE fork?

This looks like the same issue that Paula had, from your logs it seems that the original JUCE version (master branch) is used instead than the headless one.

1 Like

I see. I never switched branches. Silly me. Thanks!!