Multiple definition of BinaryData::getNamedResource() when linking Juce library


#1

Only showing up on Android for some reason, but libraries that define resource that are linked into projects containing resources causes multiple definitions of this and namedResourceList()


#2

I guess you are building static libraries? It should ignore any multiple definitions - which may not be the thing you want, especially if you are mixing JUCE versions.


#3

Hi, yes, building static libs - only an issue on Android so I guess it doesn’t ignore by default. I guess my solution is just to add that option to the build flags. thx


#4

Hi Fabian. Still getting my head round this overly complicated Android system - any idea what flags to pass in order to ignore duplicates? thx


#5

Hi @leehu, we are doing the same at ROLI with our NOISE app and it just seems to ignore the duplicates. Are you sure that both projects are pointing to the exact same version of JUCE and use the exact same build settings? Otherwise the symbols may differ and I think that’s when Android will complain.


#6

Hi, yes, they’re both basically vanilla projects, all the Android settings are left at their defaults. I don’t get the multiple issue problems on any other builds, only the Android ones. Putting a #ifdef round the one of the function definitions solves the issue, but this gets overwritten next time I save the project in Projucer.


#7

Did you try in the Projucer project settings to set a different namespace, either in the libs or in the app?
That should resolve the problem:
33

HTH


#8

ah, lovely the, never noticed that little gem there. Problem solved, thx