• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Unable to compile Cocoa/Objective-C program to C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unable to compile Cocoa/Objective-C program to C++


  • Subject: Unable to compile Cocoa/Objective-C program to C++
  • From: Paul Johnson <email@hidden>
  • Date: Sun, 12 May 2013 11:03:44 -0500

In my Cocoa/Objective-C program I'm trying to access 3rd party
software written in C++.

I'm trying to use Objective-C++ to accomplish this but it appears that
Xcode is not recognizing the file where I call the C++ as having been
written in Objective-C++. (The long compiler command contains '-x
objective-c'.) I've renamed the file to give it a .mm extension, which
is the extension used for Objective-C++ files, and I've also set the
File Type to 'Default- Objective-C++' in the Identity and Type section
of the File Inspector. I also removed the Objective-C++ file from my
project and reinserted it.)

I #include one header from the 3rd party software and have one line
that calls the software to instantiate a C++ object there. This header
file references other header files and one of them has the line
'#include <string>'. The compiler complains that it can't find the
file 'string'.

I used the 'locate' command in Terminal to find the 'string' file, and
found two occurrences, one at /usr/include/c++/4.2.1/string and
another at /usr/lib/c++/v1/string.

I've tried adding /usr/include/c++/4.2.1 to the HEADER_SEARCH_PATHS in
Xcode but get lots of additional compile errors.

Can someone help me with this issue with calling C++?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Unable to compile Cocoa/Objective-C program to C++
      • From: Paul Johnson <email@hidden>
  • Prev by Date: instruments stall
  • Next by Date: Re: Unable to compile Cocoa/Objective-C program to C++
  • Previous by thread: Re: instruments stall
  • Next by thread: Re: Unable to compile Cocoa/Objective-C program to C++
  • Index(es):
    • Date
    • Thread