Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6668091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:00:10+00:00 2026-05-26T03:00:10+00:00

Compiling my last build in Release mode i get some errors like : passing

  • 0

Compiling my last build in Release mode i get some errors like :

passing 'NSRect' (aka 'struct _NSRect') to parameter of incompatible type 'CGRect' (aka 'struct CGRect')

It is true, i’m using NSRect as CGRect and vice versa but i don’t get these errors in Debug mode.

For example, this like produces an error (not in Debug mode):

CGRect rect = [[someObject window]frame];

Now i’ve corrected every errors using functions like NSRectToCGRect and NSRectFromCGRect but i’m curious to understand why this happens only in Release mode.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:00:10+00:00Added an answer on May 26, 2026 at 3:00 am

    For example, this like produces an error (not in Debug mode):

    CGRect rect = [someObject window]frame];
    

    Well, that’s because that’s invalid code. You’re missing a [.

    More to the point:

    passing 'NSRect' (aka 'struct _NSRect') to parameter of incompatible type 'CGRect' (aka 'struct CGRect')
    

    It is true, i’m using NSRect as CGRect and vice versa but i don’t get these errors in Debug mode.

    By default, the Debug configuration builds only the active architecture, which is the architecture of the current run destination (the right half of the Scheme pop-up, assuming you’re using Xcode 4). If it’s set to “My Mac 64-bit”, that would be why it’s always worked.

    Try this: Change the run destination to “My Mac 32-bit”, then try to Run.

    See?

    In 64-bit Mac OS X, NSRect is defined as CGRect, which is how you’re able to freely convert between them. In 32-bit Mac OS X, NSRect is defined separately, so you can’t just cast from one value type to the other. They’re defined the same, so you can do pointer-aliasing or go through a union and it will work, but you can’t just cast, implicitly or explicitly, because they are separate, unrelated definitions.

    There are two solutions:

    • Drop support for 32-bit from your app. Set your Architectures in all configurations to “Standard Intel 64-bit”.
    • In your prefix header or in the Preprocessor Macros build setting, define the NS_BUILD_32_LIKE_64 macro to 1. When this is defined to a true value, NSRect will be defined as CGRect (and likewise the other geometry types), even on 32-bit.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Compiling my project against STLPort I get some weird build errors. Weird, because the
When compiling my app with LLVM, just about the only errors I get are:
When compiling my C++ .Net application I get 104 warnings of the type: Warning
When compiling an ASP.NET 2.0 App names MySite for deployment I get a series
In python, I'm compiling a regular expression pattern like so: rule_remark_pattern = re.compile('access-list shc-[(in)(out)]
I tried compiling a project that Iv ben working on for the last couple
I'm compiling some MATLAB functions into a C DLL. The exported mlf functions return
How I can prevent the last line of this code from compiling? #include <boost/optional.hpp>
On a web site I published (pre-compiled) last night, I get the following error.
Compiling a C++ file takes a very long time when compared to C# and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.