[FIXED] juceaide fails with gcc12

Hi! I noticed that JUCE cmake projects will fail on Arch Linux and OpenSUSE Tumbleweed because gcc12 is the default compiler, which causes the error:

PlugData/Libraries/JUCE/modules/juce_gui_basics/windows/juce_ComponentPeer.h:504:18:
error: ‘exchange’ is not a member of ‘std’

504 |         if (std::exchange (style, s) != style)
	|                  ^~~~~~~~

This happened while building juceaide, not while building a project. It is solved by using gcc11 like this:

CC=/usr/bin/gcc-11 CXX=/usr/bin/g++-11 cmake ..  -G "Unix Makefiles" 

But it would be nice to have support for gcc12 out of the box.

Off topic, but I’ve collected installation commands for all dependencies for every major Linux distro, maybe you could consider adding them to “Linux Dependencies.md”, they are as following:

Debian: Ubuntu command works, but you may need to install cmake, make and gcc

Fedora:

sudo dnf install alsa-lib-devel libXinerama-devel freetype-devel libcurl-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel cmake gcc-c++ 

OpenSUSE Leap:

sudo zypper refresh
sudo zypper instal alsa-lib-devel libXinerama-devel freetype-devel libcurl-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel freetype2-devel gcc gcc-c++ cmake

Arch:

sudo pacman -Sy
sudo pacman -S alsa-lib freetype2 libx11 libxcursor libxext libxinerama libxrandr libxrender webkit2gtk cmake make gcc11 pkgconf

These work from a clean installation, but also contain dependencies for cmake/make based projects. If you prefer I could take those dependencies out. I’ll be notified by GitHub when the dependencies break, so I can let you know if anything changes, but even if they end up wrong over time, it’s still better than having to guess all the packages names yourself.

When this bug if fixed, the OpenSUSE Leap dependencies will also work for Tumbleweed, and gcc11 in the Arch dependencies should be replaced by gcc.

1 Like

Thanks for that! Having dependencies for all Linux platforms/distributions into one up-to-date page would be awesome. That could be managed by users as the PR are rarely/slowly accepted onto the JUCE repository.

1 Like

I guess this is fixed.

1 Like

Thanks, I didn’t find the that thread!

I tried to sum up all dependencies i found on this forum there:

It’s not tested for now. I’ll make something more neat once fully tested from fresh installs.

2 Likes