No match for 'operator!=' compile error

So i decided it was time to download the latest core firmware files and get rid of the IPAddress warnings that were fixed a few weeks ago. problem is now i get an error

Im getting this error now when i compile, and i have no idea how to fix it!!! I kind of know what it means… or what its saying… but i don’t know where to begin fixing it!

DNSClient.cpp: In member function 'uint32_t DNSClient::ProcessResponse(IPAddress&)':
DNSClient.cpp:286:22: error: no match for 'operator!=' (operand types are 'IPAddress' and 'IPAddress')
if ( (iDNSServer != iUdp.remoteIP()) || (iUdp.remotePort() != DNS_PORT) )

This is for the DNSclient i ported a while back,

I had a quick look at the implementation of IPAddress (this is the type you try to compare) and it actually does not contain a declaration for the != operator.
But you can get arround by employing the existing == operator and just inverting the result, like this:

if ( !(iDNSServer == iUdp.remoteIP()) || !(iUdp.remotePort() == DNS_PORT) )
1 Like

That worked thanks, well it didn’t throw an error anyway!

now to sift through and change the other 100 odd errors for things that have changed!

Glad to have been of any help :smiley:

1 Like