cefclient not compiling on mac

This is more of a reference for me. If any of you are facing compilation issues on Mac, here's what I did after downloading the CEF.

  1. Open the cefclient Xcode project
  2. Change the compiler to LLVM GCC 4.2 for all targets

Now, when I tried to build it I got these errors:


/cef_binary_3.1547.1412_macosx64/cefclient/cefclient_osr_widget_mac.mm:499: 'ClientOpenGLView' may not respond to '-sendScrollWheelEvet:'
 /cef_binary_3.1547.1412_macosx64/cefclient/cefclient_osr_widget_mac.mm:63: Unknown property attribute
 /cef_binary_3.1547.1412_macosx64/cefclient/cefclient_osr_widget_mac.mm:63: Syntax error in @property's attribute declaration

THE FIX

  1. Open the file - cefclient_osr_widget_mac.mm
  2. sendScrollWheelEvet can be fixed by either moving the method up before it is being called - move it above shortCircuitScrollWheelEvent, or better still, put it in the method declaration at the top of the file
  3. By default properties are atomic and readwrite. Check out this article on properties for further clarity check this apple documentation - Apple Developer Guide - @property info. So you can change
    @property (readwrite, atomic) bool was_last_mouse_down_on_view;
    
    to:
    @property (atomic) bool was_last_mouse_down_on_view;
    or to:
    @property bool was_last_mouse_down_on_view;

Now, try compiling - voila! We are back in business!

comments powered by Disqus