String: how do I solve ambiguous overload for operator ==?


#1

in the code

String ext ( “zxcv”) ;
if ( ext == “.” ) {

i get the error:

error: ambiguous overload for ‘operator==’ in ‘ext == “.”’

note: candidates are:
operator==(const char*, const char*)
bool juce::String::operator==(const juce::String&) const

how do i solve this ?? i have loads of similar code where i test String’s agains string literals…

it appears to be to do with the inclusion of parts of the STL ( i use vectors ) how can i make JUCE and the STL live together happily ?


#2

OK - ! solved.

just had to wrap all my string literals with T(…)

as they say : “RTM” :slight_smile: