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 9208873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:42:41+00:00 2026-06-18T00:42:41+00:00

In Xcode, I’ve created a Cocoa application project. One of its dependencies is a

  • 0

In Xcode, I’ve created a “Cocoa application” project. One of its dependencies is a framework containing C++ code. I renamed AppDelegate.m to AppDelegate.mm and included the framework.

The project fails to compile. The problem is that the C++ header files in the framework are using some symbols that conflict with Objective-C or Cocoa.

  • The C++ header files are defining functions called verify() and check(), which conflict with /usr/include/AssertMacros.h in the MacOSX10.8 SDK.
  • The C++ header files contain a variable called NO, which conflicts with the Objective-C macro NO.

A workaround would be to modify the C++ code in the framework to avoid these conflicts. But since it’s a large C++ project maintained by another organization, this would take time and would possibly break in future updates of the C++ project.

Is there some way just to tell Clang/Xcode to treat those C++ header files as C++ instead of Objective-C++?

  • 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-06-18T00:42:42+00:00Added an answer on June 18, 2026 at 12:42 am

    Reading through the /usr/include/AssertMacros.h that comes with Mac OS 10.8, it looks like you could do:

    #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
    

    before including AssertMacros.h, which will prevent it from defining macros called verify() and check().

    Regarding NO: you could use the preprocessor to rename that variable for you. For example:

    #define NO NO_libraryname_renamed
    #include <libraryname.hh>
    #undef NO
    

    Depending on how the NO variable is used by the library, this might cause problems — if the header is declaring it as extern, then your Cocoa app will refer to it by the wrong name, and you’ll get an undefined symbol error. But as long as you’re not using that variable, and the library isn’t depending on your app to define that variable, then you should be fine.

    (And please file a bug report with the offending library, requesting that they rename their variable.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Xcode 4 project contains two targets: " normal " application target and " test
Xcode looked at this line and did not complain. Project built, code crashed at
Xcode automatically resizes and applies a glossy look to images added as the application
XCode 4.31 crash when i try to open my project. I could open any
Xcode 3 had the easy to use Project-> Rename in case I wanted to
XCode frequently seems to lose it's mind, and doesn't color code system classes or
Xcode is doing something bizzare which I at one point in time fixed but
Xcode has these handy time savers in the scripts menu called Code->Place Accessor Defs
Xcode Project: How to create conditional build via Xcode Project I had tried to
Xcode 4.2 Now I have two project name with game.xcodeproj and core.xcodeproj I want

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.