Trouble compiling JUCE projects in Ubuntu 18.04

Hello, this my first post here! I’m completely new to JUCE and fairly new to programming, so it’s likely that I’m making some very basic mistakes.

On Ubuntu 18.04, I’m trying to make a GUI app with a single slider, just in order to get off the ground, following the instructions on a youtube video. When I try to run the makefile in the command line, I get the following error:

In file included from /usr/include/webkitgtk-4.0/webkit2/webkit2.h:54:0,
from ../../../../../../../usr/share/juce/modules/juce_gui_extra/juce_gui_extra.cpp:106,
from ../../JuceLibraryCode/include_juce_gui_extra.cpp:9:
/usr/include/webkitgtk-4.0/webkit2/WebKitJavascriptResult.h:28:10: fatal error: jsc/jsc.h: No such file or directory
#include <jsc/jsc.h>

I ran into the same problem when trying to compile Projucer 5.3.2, and I think it’s a problem with this bug on the webkit2gtk dependency. (I was trying to compile because I couldn’t get Projucer 5.3.2 to run out of the box on Ubuntu because of this bug; I managed to solve that by installing libcurl3, but clearly problems remain).

Has anyone else encountered this problem? Is there a way around it?

Go to the modules list in Projucer, select ‘juce_gui_extra’ module and set JUCE_WEB_BROWSER flag as ‘Disabled’, save project and try to compile again.

Thank you for the quick response! I’ve done what you suggested, but now I get a new error message:

/usr/bin/ld: build/intermediate/Debug/include_juce_graphics_f817e147.o: undefined reference to symbol 'png_set_sBIT@@PNG16_0'
//usr/lib/x86_64-linux-gnu/libpng16.so.16: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:92: recipe for target 'build/NewProject' failed
make: *** [build/NewProject] Error 1

This one I can’t decode at all. On the plus side though, I’ve learned what a module is!

How did you install all of the dependencies?

This was a bug in webkitgtk-dev in the ubuntu 18.04 package repos. The fix was rolled out 12 hours ago.

To fix this you should only need to run ‘sudo apt update && sudo apt upgrade’

Source:
https://bugs.launchpad.net/ubuntu/+source/webkit2gtk/+bug/1795901

2 Likes

Returning to this after several days. The webkit update does it! I can now compile from Projucer. Thanks for your help. I hope I get such a good response the next time I get stuck!

1 Like

I’m getting exactly the same error:

/usr/bin/ld: build/intermediate/Debug/include_juce_graphics_f817e147.o: undefined reference to symbol 'png_set_sBIT@@PNG16_0'
/usr/bin/ld: //usr/lib/x86_64-linux-gnu/libpng16.so.16: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:97: build/testaudioapplication] Error 1

When building the standard Audio Application from the projucer. On Lubuntu 18.10 (having run: ‘sudo apt update && sudo apt upgrade’, and have libwebkit2gtk-4.0-dev installed. Compiling the GUI Application works fine… OKAY WAIT! That’s now not working either. Although it worked fine all of yesterday!

I have found a fix here: https://github.com/WeAreROLI/JUCE/issues/499#issue-418989597

Which is to modify line 44 of the Makefile to say this instead:

JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) 
$(shell pkg-config --libs alsa freetype2 libcurl x11 xext xinerama 
webkit2gtk-4.0 gtk+-x11-3.0) -lGL -ldl -lpthread -lrt -lpng16 -lz -ljpeg
 -lFLAC -logg -lvorbis -lvorbisenc -lvorbisfile $(LDFLAGS)

You should read the whole thread (or at least starting from Projucer Linux Makefile Linking error: undefined reference to symbol · Issue #499 · juce-framework/JUCE · GitHub). The actual solution is to not use the juce-modules-source and juce-tools Debian packages.

I did read the whole thread. I didn’t use those debian packages to install JUCE. I got JUCE from the website, and installed it onto a fresh Lubuntu 18.10 and it was working fine all of yesterday.

Some what surprisingly. make has no problems compiling the demo project of the Sine Wave Synthesiser tutorial I just downloaded.

Then it should still work. I’ve just created a new “Audio Application” project in Projucer on Ubuntu 18.10 and I was able to compile, link, and run it successfully without making any changes to the Makefile.

I would be very happy to help you figure out what is going on. I got a lot of experience helping @fbosio on Projucer Linux Makefile Linking error: undefined reference to symbol · Issue #499 · juce-framework/JUCE · GitHub now :smile:

Hi McMartin, I appreciate that, but I’d rather you gave me your time when I actually need it. :slight_smile: I’m not close to producing anything worthwhile, and I’m happy to use the workaround until I do. Besdies, I’m sure with an update or clean install or something, it will fix itself.

I only really posted in this thread so that anyone in the future may find a solution to a similar problem.

Cheers again.

1 Like

Hmm sadly I have to revive the thread. Before it all compiled well in Ubuntu 18.04, but since I formated today and tried to compile following the same steps and packages installed I have the “DSO missing from command line” error from OP.
At the same time I also managed to successfully compile Projucer and my own projects in a Raspberry Pi 3, but trying exactly the same on a different board (arm 64 bits) gives me the same DSO error as in my laptop. So now I have exactly the same situation in x86_64 (laptop) and ARM64 (board).

I can deal with it not working in my laptop since I use macOS, but I have to fix it anyway for the ARM board. So back to the matter of compiling, I read the whole thread in github and tried:

  • Changing modules path, and making a local copy of modules in the project folder
  • Adding those suggested flags on the make file
  • Using clang and g++, both giving the same outcome.
  • Installing juce tools & packages
  • Building the downloaded files from web that include the compiled binary (to see if it worked) and git cloning

Edit: forgot to say, yesterday managed to compile Projucer in the ARM64 board (IIRC after many failed attempts to link it and with gcc-8, even thought now it fails again) but it built a Shared Library archive instead of an executable one.

Calls:

export TARGET_ARCH=-march=armv8.3-a
make CXX=clang-7 -j6

Output:

Compiling include_juce_audio_devices.cpp
Compiling Main.cpp
Compiling include_juce_audio_formats.cpp
Compiling include_juce_audio_basics.cpp
Compiling include_juce_audio_processors.cpp
Compiling MainComponent.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
Compiling include_juce_gui_basics.cpp
Compiling include_juce_gui_extra.cpp
Compiling include_juce_opengl.cpp
Linking helloTest - App
    /usr/bin/ld: build/intermediate/Debug/include_juce_graphics_f817e147.o: undefined reference to symbol 'hypot@@GLIBC_2.17'
    //lib/aarch64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Makefile:91: recipe for target 'build/helloTest' failed
    make: *** [build/helloTest] Error 1

Also, as suggested I recompiled with -fPIC with no avail.

Hello every body.
I tried to install JUCE today on linux ubuntu 18.04. I downloaded JUCE from the website and tried to launch: JUCE/Projucer but i get the error:
./Projucer: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29’ not found (required by ./Projucer)
Does someone knows what i can do please?
Thanks a lot,
Frédéric.