Getting started on Ubuntu

Hello JUCE community,

I’m literally new to the framework and I’m unable to run a simple hello world VST plugin using Ubuntu 21.04 in Clion. I was able to run the project manually but I don’t know how to make the task easier.

This is what I’ve done:

  1. I cloned the git repository to my home folder: GitHub - juce-framework/JUCE: JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins.
  2. Installed all the dependencies I found on /doc/Linux_dependencies.md with the command
    sudo apt update
    sudo apt install libasound2-dev libjack-jackd2-dev \
        ladspa-sdk \
        libcurl4-openssl-dev  \
        libfreetype6-dev \
        libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev \
        libwebkit2gtk-4.0-dev \
        libglu1-mesa-dev mesa-common-dev
  1. cd JUCE/extras/Projucer/Builds/LinuxMakefile and make the projucer
  2. cd build and executed projucer ./Projucer
  3. Made a new project called CChords using the template Plug-in Basic
  4. Saved the project into ~/Documents/plugin/CChords
  5. I changed directory cd ~/Documents/plugin/CChords/Builds/LinuxMakefile and make the plugin
  6. I built as well the AudioPluginHost following the same procedure in ~/JUCE/...
  7. I launched from terminal AudioPluginHost and refreshed manually the plugins until I found my CChords.
  8. On the Plug-in Host I clicked on show plugin GUI button and there it was !

Unfortunately, I was unable to set something easily with CLion for instance open the makefile project edit the source and when I hit the run button I can have everything set.

I tried to open the folder ~/Documents/plugin/CChords/ with Clion and then I was unable to build it or run it with Clion. Does anyone knows how to configure Clion with JUCE in a convenient way?

TLDR:
I’m happy to start coding with JUCE and I hope someone else use Clion on Linux

Have you added a CLion exporter to your CChords project in the Projucer? You should do this first, then save in Projucer again. Then you should have a CLion folder that you can use in CLion.

Alternately you can not use the projucer at all and instead use cmake juce 6 api which then clion will read and work with wonderfully. (All my juce projects are cmake and clion and work great in ubuntu 20.04)

2 Likes

Hello,
Thank you for your answer.
Unfortunately, this exporter is apparently deprecated.


However, if I save the exporter anyway and try to open ~/Documents/plugin/CChords/Builds/CLion/CMakeLists.txt as a project it is working fine. But for now, I’m not sure what this implies exactly.

I think it means that while it might work, you won’t get much support from the devs if it doesn’t :wink: CMake is a better option these days.

Hello,
Finally I was able to compile my plugin with 3 different ways:

  1. Using Command Line (building project and launching Plug-in Host)
  2. Using Projucer CLion Export
  3. Using MakeFile and CLion and launching Plug-in Host from terminal

However, I’m stuck for CLion configuration. How can I load the CMakelistproject in the same time as the source? This is a basic question and I’m unable to answer it by myself. This is what I tried:

  1. Open ~/Documents/plugin/CChords/Builds/CLion/CMakeLists.txt as a project (it opens only the build directory and not the source)
  2. Open the directory of my plugin ~/Documents/plugin/CChords/ and then I’m unable to load the CMakelists configuration
  3. Open ~/Documents/plugin/CChords/Builds/LinuxMakefile/makefile as a project (it opens only the build directory and not the source)

This is kind of akward but setting the idea is the hardest part of the project. Getting started is a huge leap for newbie like me^^ I’m glad this forum exist and received an answer so quickly !

I think you might have better success using CMake rather than the Projucer. I remember when using the Projucer to create CLion projects I had issues with it not loading the source dirs. In most cases CLion would auto-suggest loading a top level directory which sorted the problem, but I remember being at the mercy of CLion. I don’t think you will hit these issues if you create your JUCE project with CMake to begin with.

1 Like

@rory is correct. Basically “don’t use projucer use cmake”

Try this

cd (some dev directory)
git clone https://github.com/surge-synthesizer/tuning-workbench-synth.git
cd tuning-workbench-synth
git submodule update --init --recursive

then open the tuning-workbench-synth directory in CLIon. It will ask if you trust the CMakeFile - say yes - then it will load the CMakeFile and once it has you will see a target tuning-workbench-synth_Standalone on which you can press run and it will build and run

If you want a more complicated cmake config you can replace tuning-workbench-synth with surge above but follow the same procedure.

If you want to be projucer vs cmake based you will have to do something clever to use clion and I’m not sure what that is.

hope that helps!

Oh and I had forgotten
When I was first noodling around with JUCE VST parameter automation for surge (we recently ported surge to JUCE) I wrote a tiny little parameter only toy with a super minimal cmake file.

may be another useful example?

1 Like