error: invalid operands to binary expression

Chris H bsd-lists at BSDforge.com
Wed Dec 20 03:56:31 UTC 2017


On Tue, 19 Dec 2017 22:18:20 -0500 "George Mitchell" <george+freebsd at m5p.com> said

> On 12/19/17 22:12, Chris H wrote:
> > Apologies if this was better posted on ports at . But given the
> > circumstances, I thought this might be a better choice. :-)
> > OK I've been hacking on this port all day. I've silenced all
> > the warnings, and errors; save one:
> > 
> > ImageEventBox.cpp:152:26: error: invalid operands to binary expression
> > ('Glib::RefPtr<Gdk::Pixbuf>' and 'int')
> >        if(ImagePixbuf_Original != 0 && loaded == true)
> >           ~~~~~~~~~~~~~~~~~~~~ ^  ~
> > 
> > This *should* be easy to deal with, and I'm probably just over
> > complicating it. But I'm stuck. Please help.
> > 
> > Thanks!
> > 
> > --Chris
> > [...]
> 
> Glib::RefPtr can't be compared to an integer.  Compare it to NULL (or
> nullptr in C++11).  Or implicitly convert it to bool:
Yep. it's c++11
> 
> if(ImagePixbuf_Original && loaded == true)
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I *knew* I was over complicating things. That was it, George.
Thank you, thank you, thank you.

--Chris

> 
> -- George




More information about the freebsd-hackers mailing list