JUCE and g++ v8.2 [SOLVED]

Upgraded to the new Ubuntu 18.10 this weekend, which has gnu g++ v8.2. This has brought up some problems when trying to compile JUCE v5.3.1-155. For example:

modules/juce_graphics/native/juce_RenderingHelpers.h:969:24:
error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class juce::PixelAlpha’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]

modules/juce_core/containers/juce_Array.h:479:25:
error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class juce::Rectangle<int>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
                 memmove (insertPos + 1, insertPos, ((size_t) numberToMove) * sizeof (ElementType));

modules/juce_core/memory/juce_HeapBlock.h:266:74:
error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘class juce::Rectangle<int>’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess]
                                                           : std::realloc (data, static_cast<size_t> (newNumElements) * elementSize));
                                                             ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Stéphane

Are you perhaps not on the latest version? This stuff was all fixed recently…

OK, I’ll check again and report back.

This is the version I’m using:

> grep -C1 JUCE_M modules/juce_core/system/juce_StandardHeader.h 
*/
#define JUCE_MAJOR_VERSION      5
#define JUCE_MINOR_VERSION      3
#define JUCE_BUILDNUMBER        2

But I’m a bit confused, because the “git” command gives me a different version number:

> git describe --long
5.3.1-155-g0b973fd92

Stéphane

I don’t know why git doesn’t realize that there is a 5.3.2 tag, but 155 commits after 5.3.1 is about 28 commits after 5.3.2, which is quite old, around beginning of May 2018.

This is all I know:

stephane@dev-vm ~/p/juce (master)> git pull
Already up-to-date.
stephane@dev-vm ~/p/juce (master)> git branch --list
  develop
* master
stephane@dev-vm ~/p/juce (master)> git describe
5.3.1-155-g0b973fd92

Should I be on “master”, or “develop”? Maybe I’m on the wrong branch?

OK, maybe this explains it, found some more info:

> git remote show origin
* remote origin
  Fetch URL: https://github.com/julianstorer/JUCE.git
  Push  URL: https://github.com/julianstorer/JUCE.git
  HEAD branch: master

Meanwhile, on my other dev vm, I get this:

> git remote show origin
* remote origin
  Fetch URL: https://github.com/WeAreROLI/JUCE.git
  Push  URL: https://github.com/WeAreROLI/JUCE.git
  HEAD branch: master
  Remote branches:
    GoldenSHA tracked
    develop   tracked
    master    tracked

So I’m guessing the julianstorer version is out-of-date, and I should just be using the WeAreROLI one. Going to try and update that to see if it fixes everything.

Nevermind, as far as I can tell the URLs https://github.com/julianstorer/JUCE.git and https://github.com/WeAreROLI/JUCE.git are exactly the same.

I did a brand new checkout of what I believe to be the correct version:

> git clone https://github.com/WeAreROLI/JUCE.git

This gave me this version:

5.3.1-138-gefddea0ef

Why do you say that this version was in May 2018? Am I grabbing it from the wrong location, or perhaps on the wrong branch?

Either way – I can definitely confirm I cannot build JUCE with the newer gnu g++ compiler included with Ubuntu 18.10. The errors described at the top of this post seem to still exist in the codebase.

Indeed. GitHub handles the redirection.

5.3.1-138-gefddea0ef is the current master branch, which currently contains 11 commits after 5.3.2. The develop branch contains 478 commits after 5.3.2. What @jules referred as “latest version” in his post is the develop branch.

My bad, I hadn’t understood.

I switched from “master” to the “develop” branch and the problems have indeed been resolved. Thank you!