DBG operator on Android fails build


#1

Hi everybody,

in my app I am using DBG, and it works fine on all other platforms. But on Android it seems to miss an overload for the stream operator:

  FAILED: /Users/Dobby/Library/Android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++  --target=armv5te-none-linux-androideabi --gcc-toolchain=/Users/Dobby/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/Dobby/Library/Android/sdk/ndk-bundle/sysroot  -DDEBUG=1 -DJUCER_ANDROIDSTUDIO_7F0E4A25=1 -DJUCE_ANDROID=1 -DJUCE_ANDROID_ACTIVITY_CLASSNAME=com_filmstro_filmstroplayer -DJUCE_ANDROID_ACTIVITY_CLASSPATH=\"com/filmstro/filmstroplayer\" -DJUCE_ANDROID_API_VERSION=10 -DJUCE_APP_VERSION=1.0.3 -DJUCE_APP_VERSION_HEX=0x10003 -D_DEBUG=1 -Djuce_jni_EXPORTS -I../../../../../../../JuceLibraryCode -I../../../../../../../../../../filmstro_modules -I../../../../../../../../../../JUCE/modules -I/Users/Dobby/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures -I../../../../../../../../FilmstroLib/Source -isystem /Users/Dobby/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include -isystem /Users/Dobby/Library/Android/sdk/ndk-bundle/sources/android/support/include -isystem /Users/Dobby/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++abi/include -isystem /Users/Dobby/Library/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -marm -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -fexceptions -frtti -fsigned-char -std=c++11 -O0 -fno-limit-debug-info -O0 -fPIC -MD -MT CMakeFiles/juce_jni.dir/Users/Dobby/Developer/Filmstro/FSP/FSP-431/FSAudioEngine/Projects/Filmstro3rdParty/FilmstroPlayer/JuceLibraryCode/include_filmstro_audioeffects_FSCompressor.cpp.o -MF CMakeFiles/juce_jni.dir/Users/Dobby/Developer/Filmstro/FSP/FSP-431/FSAudioEngine/Projects/Filmstro3rdParty/FilmstroPlayer/JuceLibraryCode/include_filmstro_audioeffects_FSCompressor.cpp.o.d -o CMakeFiles/juce_jni.dir/Users/Dobby/Developer/Filmstro/FSP/FSP-431/FSAudioEngine/Projects/Filmstro3rdParty/FilmstroPlayer/JuceLibraryCode/include_filmstro_audioeffects_FSCompressor.cpp.o -c /Users/Dobby/Developer/Filmstro/FSP/FSP-431/FSAudioEngine/Projects/Filmstro3rdParty/FilmstroPlayer/JuceLibraryCode/include_filmstro_audioeffects_FSCompressor.cpp
  In file included from /Users/Dobby/Developer/Filmstro/FSP/FSP-431/FSAudioEngine/Projects/Filmstro3rdParty/FilmstroPlayer/JuceLibraryCode/include_filmstro_audioeffects_FSCompressor.cpp:9:
  In file included from ../../../../../../../../../../filmstro_modules/filmstro_audioeffects/filmstro_audioeffects_FSCompressor.cpp:4:
  In file included from ../../../../../../../JuceLibraryCode/../JuceLibraryCode/JuceHeader.h:19:
  In file included from ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes.h:46:
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: error: use of overloaded operator '<<' is ambiguous (with operand types 'juce::String' and 'std::__ndk1::set<int, std::__ndk1::less<int>, std::__ndk1::allocator<int> >::size_type' (aka 'unsigned int'))
          DBG ("Unique stems: " << used.size());
          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
  ../../../../../../../../../../JUCE/modules/juce_core/system/juce_PlatformDefs.h:118:110: note: expanded from macro 'DBG'
    #define DBG(textToWrite)          JUCE_BLOCK_WITH_FORCED_SEMICOLON (juce::String tempDbgBuf; tempDbgBuf << textToWrite; juce::Logger::outputDebugString (tempDbgBuf);)
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../../../../../../../../../../JUCE/modules/juce_core/system/juce_PlatformDefs.h:103:51: note: expanded from macro 'JUCE_BLOCK_WITH_FORCED_SEMICOLON'
   #define JUCE_BLOCK_WITH_FORCED_SEMICOLON(x) do { x } while (false)
                                                    ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1313:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, char characterToAppend);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1315:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, wchar_t characterToAppend);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1331:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, short number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1333:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1335:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, long number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1337:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, unsigned long number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1339:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, int64 number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1341:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, uint64 number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1343:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, float number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1345:32: note: candidate function
  JUCE_API String& JUCE_CALLTYPE operator<< (String& string1, double number);
                                 ^
  ../../../../../../../../../../JUCE/modules/juce_core/text/juce_String.h:1349:32: note: candidate function has been explicitly deleted
  JUCE_API String& JUCE_CALLTYPE operator<< (String&, bool) = delete;
                                 ^
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, unsigned int)
          DBG ("Unique stems: " << used.size());
                                ^
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(int, unsigned __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, unsigned int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, unsigned int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, unsigned int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, unsigned int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, unsigned int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, unsigned int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, unsigned int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, unsigned __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long long, unsigned __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(__int128, unsigned __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned int, unsigned __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long, unsigned __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned long long, unsigned __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, __int128)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(long, int)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, unsigned long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, unsigned long long)
  ../../../../../../../../../../filmstro_modules/filmstro_themes/filmstro_themes_ThemeMixVolumes.h:92:31: note: built-in candidate operator<<(unsigned __int128, unsigned __int128)
  1 error generated.
  ninja: build stopped: subcommand failed.

I wonder, how come it only fails on Android (building on OSX using gradle, AndroidStudio 2.3.3 installed).
But should be easy to fix by adding that overload for unsignet int.

Thanks for looking into
Daniel


#2

ka-bump…
any chance to get an unsigned int overload? 2 minutes copy-paste job :wink:

Cheers,
Daniel


#3

Not always as simple as it sounds! The main reason there isn’t already one is that it can cause ambiguities with things like size_t (that may not be a problem now but used to be a showstopper on old VS versions).

IIRC Tom added an overload for something else in there recently and it caused all kinds of subtle problems, ended up after much head-scratching that we just took it out again. An unsigned int overload may be OK but am reluctant to just throw it in there and see what happens!


#4

I totally understand that.

As you see from the error I posted, actually I tried to output the result of std::set<int>::size() (or what the compiler sees: std::__ndk1::set<int, std::__ndk1::less<int>, std::__ndk1::allocator<int> >::size_type' (aka 'unsigned int')). So it is indeed not sure, what would be the right thing to do, that’s why I threw it at you :wink:

Also it is irritating to me, that it compiles on OSX and Windows just fine…
I can work around by explicitly casting the number, but it is strange that I have to do that.
Let me know, if you are planning to do something about that, or if I have to change my code.

Cheers