Build failures using tip 28730a28

I am using Introjucer to make LinuxMakefile project of a test project I am using. I get a few build failures. This is on Fedora 23 and Fedora 15. GCC out of the repo for each. I have tried with c++11 and c++03

Compiling Main.cpp
Compiling juce_audio_basics.cpp
In file included from ../../JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.cpp:78:0:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp: In static member function ‘static void juce::FloatVectorOperations::abs(float*, const float*, int)’:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:824:27: error: no matching function for call to ‘ignoreUnused(juce::FloatVectorOperations::abs(float*, const float*, int)::<anonymous union>&)’
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:824:27: note: candidates are:
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:280:6: note: template<class Type1> void juce::ignoreUnused(const Type1&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:283:6: note: template<class Type1, class Type2> void juce::ignoreUnused(const Type1&, const Type2&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:286:6: note: template<class Type1, class Type2, class Type3> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:289:6: note: template<class Type1, class Type2, class Type3, class Type4> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&, const Type4&)
In file included from ../../JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.cpp:78:0:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp: In static member function ‘static void juce::FloatVectorOperations::abs(double*, const double*, int)’:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:840:27: error: no matching function for call to ‘ignoreUnused(juce::FloatVectorOperations::abs(double*, const double*, int)::<anonymous union>&)’
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:840:27: note: candidates are:
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:280:6: note: template<class Type1> void juce::ignoreUnused(const Type1&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:283:6: note: template<class Type1, class Type2> void juce::ignoreUnused(const Type1&, const Type2&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:286:6: note: template<class Type1, class Type2, class Type3> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:289:6: note: template<class Type1, class Type2, class Type3, class Type4> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&, const Type4&)
make: *** [build/intermediate/Debug/juce_audio_basics_2442e4ea.o] Error 1

If I remove the calls to ignoreUnused I get a further failure

Compiling juce_audio_basics.cpp
Compiling juce_audio_devices.cpp
Compiling juce_audio_formats.cpp
Compiling juce_audio_processors.cpp
Compiling juce_core.cpp
Compiling juce_cryptography.cpp
Compiling juce_data_structures.cpp
Compiling juce_events.cpp
Compiling juce_graphics.cpp
Compiling juce_gui_basics.cpp
In file included from ../../JuceLibraryCode/modules/juce_gui_basics/juce_gui_basics.cpp:181:0:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp: In member function ‘void juce::SVGState::parseUse(const juce::SVGState::XmlPath&, juce::Path&) const’:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:568:66: error: no matching function for call to ‘juce::SVGState::XmlPath::applyOperationToChildWithID(const juce::String&, juce::SVGState::parseUse(const juce::SVGState::XmlPath&, juce::Path&) const::UsePathOp&) const’
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:568:66: note: candidate is:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:46:14: note: template<class OperationType> bool juce::SVGState::XmlPath::applyOperationToChildWithID(const juce::String&, OperationType&) const
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp: In member function ‘void juce::SVGState::parseClipPath(const juce::SVGState::XmlPath&, juce::Drawable&) const’:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:707:67: error: no matching function for call to ‘juce::SVGState::XmlPath::applyOperationToChildWithID(juce::String&, juce::SVGState::parseClipPath(const juce::SVGState::XmlPath&, juce::Drawable&) const::GetClipPathOp&) const’
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:707:67: note: candidate is:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:46:14: note: template<class OperationType> bool juce::SVGState::XmlPath::applyOperationToChildWithID(const juce::String&, OperationType&) const
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp: In member function ‘juce::FillType juce::SVGState::getGradientFillType(const juce::SVGState::XmlPath&, const juce::Path&, float) const’:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:766:78: error: no matching function for call to ‘juce::SVGState::XmlPath::applyOperationToChildWithID(juce::String, juce::SVGState::getGradientFillType(const juce::SVGState::XmlPath&, const juce::Path&, float) const::SetGradientStopsOp&) const’
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:766:78: note: candidate is:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:46:14: note: template<class OperationType> bool juce::SVGState::XmlPath::applyOperationToChildWithID(const juce::String&, OperationType&) const
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp: In member function ‘juce::FillType juce::SVGState::getPathFillType(const juce::Path&, const juce::String&, const juce::String&, const juce::String&, juce::Colour) const’:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:910:67: error: no matching function for call to ‘juce::SVGState::XmlPath::applyOperationToChildWithID(juce::String&, juce::SVGState::getPathFillType(const juce::Path&, const juce::String&, const juce::String&, const juce::String&, juce::Colour) const::GetFillTypeOp&) const’
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:910:67: note: candidate is:
../../JuceLibraryCode/modules/juce_gui_basics/drawables/juce_SVGParser.cpp:46:14: note: template<class OperationType> bool juce::SVGState::XmlPath::applyOperationToChildWithID(const juce::String&, OperationType&) const
make: *** [build/intermediate/Debug/juce_gui_basics_a630dd20.o] Error 1

Any ideas?

I was building on linux this morning, and it was fine.. The errors are a bit odd, are you using some other headers that use the symbol 'signMask"?

False alarm. I have no idea what happened. I recreated the project using Introjucer on Fedora 23 (rather than copying from mac) and it worked fine. Must be something wrong with my virtualbox shared folders or something. Sorry about that, thanks for the help.

I sometimes run into issues like this when copying files from Mac/Windows to linux. The reason for the failures is that Linux has case sensitive file names. This means that header files must match exactly in case or gcc/clang will not find them. Sometimes, the case of filenames gets mixed up when copying files between OSes.

@jules @fabian

I am hitting the same issue. I believe this is because pre C++11 we cannot use a local type or an anonymous type argument to the template function ‘ignoreUnused’. This compiles fine with C++11.

This seems like a bug in JUCE as C++11 is not a requirement.

Any thoughts?

Thanks

This is odd. My main linux test system is Fedora 23. It compiles out of the box for me. Can you post the exact error message.

Thanks for the reply @fabian

My error message is the same as Harrys but I have posted it below just in case

As you can see attempting to compile juce_audio_basics without the ‘-std=c++0x’ flag results in the error. I am using gcc 4.6.3

-bash-4.2$ gcc  -MMD -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_6D53C8B4=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules -march=native -g -ggdb -O0 -std=c++0x -o "juce_audio_basics_a742c38b.o" -c "../../JuceLibraryCode/juce_audio_basics.cpp"
-bash-4.2$ gcc  -MMD -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_6D53C8B4=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules -march=native -g -ggdb -O0 -o "juce_audio_basics_a742c38b.o" -c "../../JuceLibraryCode/juce_audio_basics.cpp"
In file included from ../../JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.cpp:85:0,
                 from ../../JuceLibraryCode/juce_audio_basics.cpp:9:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp: In static member function ‘static void juce::FloatVectorOperations::abs(float*, const float*, int)’:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:815:27: error: no matching function for call to ‘ignoreUnused(juce::FloatVectorOperations::abs(float*, const float*, int)::<anonymous union>&)’
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:815:27: note: candidates are:
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:280:6: note: template<class Type1> void juce::ignoreUnused(const Type1&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:283:6: note: template<class Type1, class Type2> void juce::ignoreUnused(const Type1&, const Type2&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:286:6: note: template<class Type1, class Type2, class Type3> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:289:6: note: template<class Type1, class Type2, class Type3, class Type4> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&, const Type4&)
In file included from ../../JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.cpp:85:0,
                 from ../../JuceLibraryCode/juce_audio_basics.cpp:9:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp: In static member function ‘static void juce::FloatVectorOperations::abs(double*, const double*, int)’:
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:831:27: error: no matching function for call to ‘ignoreUnused(juce::FloatVectorOperations::abs(double*, const double*, int)::<anonymous union>&)’
../../JuceLibraryCode/modules/juce_audio_basics/buffers/juce_FloatVectorOperations.cpp:831:27: note: candidates are:
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:280:6: note: template<class Type1> void juce::ignoreUnused(const Type1&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:283:6: note: template<class Type1, class Type2> void juce::ignoreUnused(const Type1&, const Type2&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:286:6: note: template<class Type1, class Type2, class Type3> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&)
../../JuceLibraryCode/modules/juce_audio_basics/../juce_core/maths/juce_MathsFunctions.h:289:6: note: template<class Type1, class Type2, class Type3, class Type4> void juce::ignoreUnused(const Type1&, const Type2&, const Type3&, const Type4&)
-bash-4.2$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Note: It will compile out of the box from the Makefile produced by the Projucer as it adds the -std=c++11 flag, I am using custom build scripts without the -std=c++11 flag

OK this should be fixed now on the latest develop tip.

Hi @fabian

Thanks for the patch. I noticed there were still some of the same issues mentioned before in juce_SVGParser, specifically with ‘applyOperationToChildWithID’ calls.

Cheers

Can you give me a hint which linux VM I should install to easily get gcc 4.6.3? I’ve tried the latest LTS of ubuntu but the g++ versions only go back to version g+±4.7 - and with this the error in SVG parser does not occur.

Hi

Odd how its not picking up those calls in juce_SVGParser. They are the same violations :confused:

I am using Fedora 15 which should come with gcc 4.6.3 out of the box

Cheers

Bump.

@fabian did you manage to reproduce or need any more info from me?

I still can’t seem to install gcc 4.6.3. I’ve installed Fedora 15 but it can’t update/install any packages from the online repositories as the ssl keys have long expired. Could you try to fix it yourself and I’ll consider patching it? Thanks!

Hi Fabian,

The two calls to ignoreUnused in the snippet below (FloatVectorOperations.cpp 815, 831) cannot be found as in CXX03 I don’t think you can use a local type in template arguments. Everything else builds fine (I commented that bit out to test).

void FloatVectorOperations::abs (float* dest, const float* src, int num) noexcept
{
   #if JUCE_USE_VDSP_FRAMEWORK
    vDSP_vabs ((float*) src, 1, dest, 1, (vDSP_Length) num);
   #else
    union { float f; uint32 i; } signMask;
    signMask.i = 0x7fffffffUL;
    JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = fabsf (src[i]), Mode::bit_and (s, mask),
                                  JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
                                  const Mode::ParallelType mask = Mode::load1 (signMask.f);)

    ignoreUnused (signMask);
   #endif
}

void FloatVectorOperations::abs (double* dest, const double* src, int num) noexcept
{
   #if JUCE_USE_VDSP_FRAMEWORK
    vDSP_vabsD ((double*) src, 1, dest, 1, (vDSP_Length) num);
   #else
    union {double d; uint64 i;} signMask;
    signMask.i = 0x7fffffffffffffffULL;

    JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = fabs (src[i]), Mode::bit_and (s, mask),
                                  JUCE_LOAD_SRC, JUCE_INCREMENT_SRC_DEST,
                                  const Mode::ParallelType mask = Mode::load1 (signMask.d);)

    ignoreUnused (signMask);
   #endif
}

I’m pretty sure I fixed the FloatVectorOperation stuff on develop. See here. However, I wasn’t able to reproduce the errors in the svg parser.

It looks to me like they are all fixed in the develop tip then. @inhwan can you confirm?

As @fabian mentioned the FloatVectorOperation stuff has already been fixed, but not the SVGParser stuff as he cannot reproduce it. I will look into it and provide a patch once time allows.

1 Like