title: Warning: XXX may not respond to YYY
body: <p>Hey, I am making some stuff in Objective-C++... And I must say that I am a total newbie when it comes to the Objective-C part... I don't really want to learn it, I kinda just need it for accessing a few Mac APIs (ObjC is such a dumb language).</p>
  
  <p>So - compiling with g++ -x objective-c++ - and I somehow keep getting this warning:</p>
  
  <pre><code>XXX may not respond to YYY
  </code></pre>
  
  <p>First it was with a NSScreen, now it is with a NSWindow:</p>
  
  <pre><code>NSWindow may not respond to +initWithContentRect:styleMask:backing:defer:
  </code></pre>
  
  <p>I saw somewhere that I should cast it to id, but didn't work, throwing absolutely cryptic errors...</p>
  
  <p>So - WHAT does this warning actually mean and HOW am I supposed to make it stop?</p>
  
  <p><strong>EDIT:</strong> Okay, apparently I need to ALLOCATE an instance first, then I can call its init function... Anyways, now the GCC is reporting:</p>
  
  <pre><code>confused by earlier errors, bailing out
  </code></pre>
  
  <p>And NOTHING else. This is the ONLY error that it reports. I figured that there is some error in my code that doesn't get reported... So I will post the whole file where the problem is here:</p>
  
  <pre><code>ONXeWindow::ONXeWindow(int px, int py, int sw, int sh, bool resizable){
      NSRect wr = NSMakeRect(px, py, sw, sh);
  
      int wf = 1; // titled
      wf += 2; // closable
      wf += 4; // miniaturizable
      wf += (resizable ? 8 : 0); // resizable
      wf += (false ? 128 : 0); // metal bg
  
      useWindow = [[NSWindow alloc] initWithContentRect:wr styleMask:wf backing:2 defer:YES];
  }
  </code></pre>
  
  <p>Also, YES, framework AppKit was imported (in the header file) - I am not going to confuse you with my weird file scheme here.</p>