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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:23:37+00:00 2026-05-23T14:23:37+00:00

I am trying to describe my problem clearly for you, so it might be

  • 0

I am trying to describe my problem clearly for you, so it might be a little long, and I really appreciate that if you can read it and provide some suggestion. Thanks.

I have a library project, let’s call it MyCppLib, which contains some legacy c++ code, and I add a adapter class in this project so that I can use it with out using objective-c++ in other project. Here is an overview of MyCppLib project.

Project MyCppLib
– some legacy c++ code
– Adapter.h
– Adapter.mm

I have another project, let’s call it Main project, which use the MyCppLib project as a static library. So I use xCode 4 to compile MyCppLib, and get libMyCppLib.a, and config Main project in xCode 4 to link it with Main project. Here is an overview of Main project.

Project Main
– Some objective-c classes which DO NOT contain ‘.mm’ file
– Adapter.h
– libMyCppLib.a as a static library

While I compile the Main project in xCode 4 I get some errors:

Undefined symbols for architecture armv6:
“operator new(unsigned long)”, referenced from:
-[Adapter init] in libMyCppLib.a(Adapter.o)
my::cpp::namespace::MyCppClass::MyCppClass()in libMyCppLib.a(MyCppClass.o)

… some other similar errors

ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status

I figure it might because the Main project do not have an objective-c++ capability, so I add a ‘.mm’ file to the Main project. And now Main project should be like this:

Project Main
– Some objective-c classes which DO NOT contain ‘.mm’ file
– Adapter.h
– libMyCppLib.a as a static library
– DummyObjCpp.h
– DummyObjCpp.mm

Then, I compile the Main project, and it succeed!

So, finally, my question is: how can I configure the Main project to have objective-c++ capability without adding a ‘.mm’ file?

  • 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-23T14:23:38+00:00Added an answer on May 23, 2026 at 2:23 pm

    OK, I’ve read over the question a few times, but I’m still not sure I understand the problem.

    While I’ve done a lot with Objective-C, C++, and Objective-C++, I haven’t encountered the scenario you’ve described with static libraries (since most of my development is for OS X rather than iOS, where dynamic libraries are allowed and preferred).

    It sounds like there might be an issue in your second project because the .h file by itself doesn’t tell enough about what’s contained in the .a (namely that when you combine it with the rest of your executable, you’ll need to be linked against libstdc++.dylib). You might try changing the “File Type” of the Adapter.h header file from the default of C header to C++ header as shown in the image below:

    enter image description here

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

Sidebar

Related Questions

The problem that I am having is a little hard to describe, so please
I have a problem that I can't resolve, and am hoping someone might have
I'm trying to write some dcg grammar in prolog which will describe language of
Sorry about the title, couldn't really think of anything else to describe the problem
I'm having a strange problem that I can't figure out that popped up when
Sorry I couldn't really describe my problem much better in the title. I am
I really don't know what title should I use to describe my problem. To
Hey everybody, Im really confused about this problem. Ill try to describe it: The
I have a ManyToMany relationship between person that I'm trying to describe with Hibernate
Not sure the title fully describes the problem/question I'm trying to ask, sorry. One

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.