Setting up on Linux, some basic questions that googling didn't answer


#1

Howdy all!

I’m new to JUCE, and also Linux and C++ (though I am proficient on Windows and OSX and comfortable with the command line, and I know some Java), so my apologies if this is a hodgepodge of newb-ish stupidity. Please feel free to link me to any relevant sources where I can educate myself if that would be preferable.

First off, I decided on the Mint distro because my impression was that it would be the “easiest”, generally. (Most user-friendly, with a large enough user base to have plenty of support.) Is there another distro that will make setting up with JUCE easier? I’m early enough in that I wouldn’t mind starting over.

What I’ve done so far is as follows:

I used the “Software Manager” to download juce-tools and juce-modules-source, and also code::blocks (an IDE). Upon opening Projucer I get the message “This version of Projucer is out of date! Always make sure that you’re running the very latest version, preferably compiled from the JUCE repository you’re working with!”

Do I actually need to update the Projucer somehow? Or maybe the Linux release available via the software manager just lags behind other releases, and so I can just ignore the warning?

Continuing, I select “GUI Application” and add “Code::Blocks (Linux)” to the Target Platforms. Clicking “Create” creates the project, but the “Save and Open in IDE” button is greyed out.

Apparently, the Linux version of Projucer did not support opening the project in an IDE for some time (and the button wasn’t even there?). Is it still not supported? The button is now there and it mentions Linux in the parentheses so I’m inclined to think that there is just something extra I have to do to allow Projucer to open the project in Code::Blocks automatically.

I’ve also seen plenty of threads where people are talking about dependencies, and I’ve downloaded many of them, but I’m not actually sure whether or not I need them, since it seems like at least some of the threads are talking about building the projucer itself, whereas it seems like that’s already taken care of for me. Should I be building the Projucer myself just for the experience?

And I guess I also want to ask, generally, are there any things to which I’m just obviously ignorant (with regards to JUCE or Linux) that I should read up on before moving forward?

Thanks very much for any help!


#2

apt-get install build-essential, the apt-get install git, then clone the JUCE repo, cd to the Projucer LinuxMakefile folder and build from there make. Then launch the now up to date Projucer and create your project.

I recommend CLion as an IDE for Linux. There is a CLion exporter in the Projucer now. As for dependencies, try building a newly exported project and you’ll see quick enough what you need. On a fresh Linux machine I usually install the following straight off:

libfreetype6-dev libx11-dev libxinerama-dev libxcursor-dev mesa-common-dev l ibasound2-dev freeglut3-dev libxcomposite-dev libjack-dev libxrandr-dev

But it depends on your system. Good luck.


#3

Thanks very much for your help! I decided to start fresh on Ubuntu with your instructions.

After cloning the repo JUCE repo (as per these instructions) and trying the make command in the Projucer folder, I got the following output:

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 containinggtk±x11-3.0.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘gtk±x11-3.0’ found
Compiling jucer_AutoUpdater.cpp
Compiling jucer_CommandLine.cpp
Compiling jucer_Main.cpp
Compiling jucer_MainWindow.cpp
Compiling jucer_ProjucerAnalytics.cpp
Compiling jucer_DocumentEditorComponent.cpp
Compiling jucer_OpenDocumentManager.cpp
Compiling jucer_SourceCodeEditor.cpp
Compiling jucer_ComponentTypeHandler.cpp
Compiling jucer_ButtonDocument.cpp
Compiling jucer_ComponentDocument.cpp
Compiling jucer_ColouredElement.cpp
Compiling jucer_PaintElement.cpp
Compiling jucer_PaintElementGroup.cpp
Compiling jucer_PaintElementImage.cpp
Compiling jucer_PaintElementPath.cpp
Compiling jucer_ComponentLayoutEditor.cpp
Compiling jucer_ComponentOverlayComponent.cpp
Compiling jucer_EditingPanelBase.cpp
Compiling jucer_JucerDocumentEditor.cpp
Compiling jucer_PaintRoutineEditor.cpp
Compiling jucer_PaintRoutinePanel.cpp
Compiling jucer_ResourceEditorPanel.cpp
Compiling jucer_TestComponent.cpp
Compiling jucer_BinaryResources.cpp
Compiling jucer_ComponentLayout.cpp
Compiling jucer_GeneratedCode.cpp
Compiling jucer_JucerDocument.cpp
Compiling jucer_ObjectTypes.cpp
Compiling jucer_PaintRoutine.cpp
Compiling jucer_LicenseController.cpp
Compiling jucer_CompileEngineClient.cpp
Compiling jucer_CompileEngineServer.cpp
Compiling jucer_DownloadCompileEngineThread.cpp
Compiling jucer_HeaderComponent.cpp
Compiling jucer_Module.cpp
Compiling jucer_Project.cpp
Compiling jucer_ProjectExporter.cpp
Compiling jucer_ProjectSaver.cpp
Compiling jucer_ResourceFile.cpp
Compiling jucer_AppearanceSettings.cpp
Compiling jucer_StoredSettings.cpp
Compiling jucer_CodeHelpers.cpp
Compiling jucer_FileHelpers.cpp
Compiling jucer_MiscUtilities.cpp
Compiling jucer_PIPGenerator.cpp
Compiling jucer_Icons.cpp
Compiling jucer_JucerTreeViewBase.cpp
Compiling jucer_ProjucerLookAndFeel.cpp
Compiling jucer_SlidingPanelComponent.cpp
Compiling jucer_NewFileWizard.cpp
Compiling jucer_NewProjectWizardClasses.cpp
Compiling BinaryData.cpp
Compiling include_juce_analytics.cpp
Compiling include_juce_core.cpp
Compiling include_juce_cryptography.cpp
Compiling include_juce_data_structures.cpp
Compiling include_juce_events.cpp
Compiling include_juce_graphics.cpp
In file included from …/…/JuceLibraryCode/include_juce_graphics.cpp:9:0:
…/…/…/…/modules/juce_graphics/juce_graphics.cpp:98:12: fatal error: ft2build.h: No such file or directory
#include <ft2build.h>
^~~~~~~~~~~~
compilation terminated.
Makefile:437: recipe for target ‘build/intermediate/Debug/include_juce_graphics_f817e147.o’ failed
make: *** [build/intermediate/Debug/include_juce_graphics_f817e147.o] Error 1

The command that fixed the above problem was:

sudo apt-get install webkit2gtk-4.0

(At first I tried this on the wrong makefile, which was in the BinaryBuilder folder, and fixed an error I got there with sudo apt-get install libcurl4-openssl-dev but that’s probably not relevant since I was in the wrong place.)

Running “make” in the projucer/builds/linuxmakefile folder after the webkit2gtk-4.0 installation, I get a “build” folder that contains a “Projucer” file and an “intermediate” folder.

The Projucer file does not run, however. I get an error that says

Could not display “Projucer”
There is no application installed for “shared library” files. Do you want to search for an application to open this file?

If I click yes, I get a pop-up message at the top of my screen that says

Additional MIME Types Required
An application is requesting additional file format support

Which makes it seem like it’s trying to open the file using another program. I have set the “Files” application (Nautilous?) to “ask what to do” when dealing with Executable Text Files, but there’s no change in behavior. Changing the name of the file from Projucer to Projucer.desktop gives an error when opening it that says “There was an error launching the application”. I also made sure that the file properties has “allow executing file as a program” checked, and double checked that by using chmod -x command, but still there was no change.

Any idea what the problem is? Did I not find the right makefile?

Thanks again for any help!


#4

Try to start the projucer in the terminal.


#5

That did it, thank you!

For anyone other newbies who come across this thread, the command was
./Projucer

(I did not know about the ./ yet myself =P)


#6

For security reasons, the current working directory is not in the search path for executables by default. Hence you have to specify it with ./. You can configure your shell (e.g. bash) to automatically include the current working directory.

I usually have a symlink from /usr/local/bin to my Projucer executable, so I can use the super helpful command line options of Projucer more easily (type ./Projucer --help)


#7

A couple of things to note here.

Those packages are not managed by the JUCE team - I don’t know where they come from so I would not trust that they are up to date.


#8

Thanks very much for all of your help.

Following this tutorial, I’ve created a Projucer Audio Plugin project, saved it, and opened it in CodeBlocks. When I hit build, however, I get this error:

File: /home/john/JUCE/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp
Message: fatal error: pluginterfaces/vst2.x/aeffect.h: no such file or directory

The tutorial itself says:

All of the files that you need to create VST and AU (MacOS only) plug-ins are packaged with JUCE (as long as you are using a recent version of JUCE).

And I did download the VST3 SDK, pointing to it in the JUCE configuration, so it seems like something funny is going on here. The error does mention vst2, could that be the problem? That JUCE has VST support by default, I added and pointed to the VST3 SDK, but it’s trying to do something related to VST2?

It is the case that, in my VST3_SDK/pluginterfaces folder (the only “pluginterfaces” folder I found on my machine), I don’t have a file or folder called vst2.x

Thanks again for any help!


#9

Looking at the code where the error occured (line 155 in the PluginProcessor.cpp file), there is an explanatory comment:

// If the following files cannot be found then you are probably trying to build
// a VST2 plug-in or a VST2-compatible VST3 plug-in. To do this you must have a
// VST2 SDK in your header search paths or use the “VST (Legacy) SDK Folder”
// field in the Projucer. The VST2 SDK can be obtained from the
// vstsdk3610_11_06_2018_build_37 (or older) VST3 SDK or JUCE version 5.3.2. You
// also need a VST2 license from Steinberg to distribute VST2 plug-ins.

This prompted me to check what I’d checked in the configuration window and, wouldn’t you know it, I had checked “VST (Legacy)”. So my first question is, in case I ever want to use that setting, does anyone know where to get that Legacy SDK?

And unfortunately, after unchecking VST Legacy (which autoselected three formats, VST3, AU, and Standalone), trying to build the project with those settings saved led to three new errors:

File: bin/Debus/libAudio
Message: No such file or directory

File: Plugin
Message: No such file or directory

File: Tutorial.a
Message: No such file or directory

These errors were listed under “Build: Standalone Plugin…”, so I went back to the Projucer and selected only VST3. Trying to build with only VST3 selected led to a strange error:

File: /home/john/JUCE/modules/juce_audio_plugin_client/utility/…/utility/juce_CheckSettingMacros.h
Message: error: #error “You need to enable at least one plugin format!”

… But I have enabled one, VST3.

Any idea what’s going on here?

Thanks again.


#10

The text in the tutorial needs to be updated. I’ll do that now.

JUCE’s embedded VST2 SDK has been removed. See the 5.4 release notes:


Those three errors look like a problem creating a file with spaces in its name: “Audio Plugin Tutorial”. This might be a JUCE bug. Does it work if you don’t use spaces?

The last error is because we don’t support VST3 on Linux. This is something we’re working on though.


#11

Those three errors look like a problem creating a file with spaces in its name: “Audio Plugin Tutorial”. This might be a JUCE bug. Does it work if you don’t use spaces?

I’m a little embarrassed that I didn’t notice it was just the name of the file separated into different erros xD Removing the spaces does fix those errors, but then some new errors pop up:

File: ~/Juce/modules/juce_core/native/juce_cur_Network.cpp
Message: undefined reference to ‘curl_easy_init’

There’s one of those errors for ‘curl_easy_setopt’, curl_easy_cleanup’, curl_easy_getinfo’, and a bunch of others.

A little bit of googling makes it seem like the issue is that I have to somehow “link” the curl library to the project, but I’m not sure how to do that.

I’m pretty sure I did install the curl library with sudo apt-get install curl, and it looks like maybe I can link it in CodeBlocks in the settings, but adding either of the curl directories on my hard drive (usr/share/doc/curl or usr/include/x86_64-linux-gnu/curl) to the “Link Libraries” in CodeBlocks (Found via Settings–>Compiler…–>Linker Settings) gives me the following error:

File: /usr/share/doc/curl
Message: No such file or directory

Do I need to link the library in the Projucer somehow? Have I not actually installed curl correctly?

The last error is because we don’t support VST3 on Linux. This is something we’re working on though.

I see. Once it’s supported, I assume there will be the JUCE_VST3_CAN_REPLACE_VST2 option available in the Projucer settings, so that one can create the VST3 plugin without VST2 dependencies?

Thanks very much again for all the help. Once I’m remotely proficient with all of this, I hope I’ll have the opportunity to help others as much as you’re helping me.


#12

You need to install the curl development package:

See here:

It will be linked automatically by CodeBlocks.

JUCE_VST3_CAN_REPLACE_VST2 is for doing the opposite - you set this when you require backwards compatible VST3 plug-ins which use VST2 SDK. It’s off by default for new projects.


#13

Actually the curl linking problems appear to come from Code::Blocks - the Linux Makefile works correctly. I’m looking at it now.


#14

Both linking curl and spaces in the project name are fixed in this commit:


#15

Both linking curl and spaces in the project name are fixed in this commit:

Very cool, thanks! Do I need to pick a “daily” release or anything like that to get the new version? I tried just redownloading/cloning JUCE from the github repository (and then rebuilding the Projucer, resaving a new project, opening it in CodeBlocks, and then hitting “build”), but it didn’t fix the spaces-in-the-project-name error. (Commits have been officially accepted into the code right? They aren’t pending or anything like that?)

Thanks again,
-J


#16

By default this will give you the content of JUCE on the master branch. However, active development is happening on the develop branch. The develop branch is merged into the master branch when the JUCE team decides it is time to make a numbered release (like 5.4.1).

If you are cloning the JUCE repository using git on the command line, then you need to checkout the develop branch:

git checkout develop

If you are downloading the JUCE code as an archive from GitHub, then you need to select the develop branch in the GitHub UI before clicking on Download ZIP: https://github.com/WeAreROLI/JUCE/archive/develop.zip


#17

Thanks a bunch, I’m now aware of github branches =)

I got the new version and the spaces-in-file-name issue has been resolved, but now I’m getting this error…

File: usr/share/doc/curl
Message: No Such File Or Directory

There is a sparse looking folder named curl there, though, with two .gz file and one text file in it:

changelog.Debian.gz
NEWS.Debian.gz
copyright

It looks like what changed is that the CodeBlocks project automatically opens with “file:///usr/share/doc/curl” entered into the “linker” settings. When I go there manually andopen the file explorer GUI that opens up for specifying the location, it’s looking specifically for *.a, *.so, *.lib, *.dylib, or *.bundle files, and doesn’t even show the curl folder that had been specified.

Is that maybe the problem? Should the curl folder have a file with one of those extensions in it? Or should the linker settings be pointed somewhere else?

For what it’s worth, I tried just compiling the project using the makefile from the command line, and that worked fine. I would really like to get an IDE going though.

Thanks again,
-J


#18

I’m surprised to see a file:/// url there…

What’s the result of running pkg-config --cflags libcurl and pkg-config --libs libcurl from the command line?


#19

Output from
pkg-config --cflags libcurl
was
-I/usr/include/x86_64-linux-gnu

and output from
pkg-config --libs libcurl
was
-lcurl

Copying “-I/usr/include/x86_64-linux-gnu” into the linker settings (in place of the other setting) allowed me to compile and run the example via CodeBlocks =)