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

  • Home
  • SEARCH
  • 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 6217683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:28:09+00:00 2026-05-24T07:28:09+00:00

I have a project with a base view controller class, that is inherited by

  • 0

I have a project with a base view controller class, that is inherited by about 25 other view controllers. Now I need to use a bit of core audio in that base class, so I’m integrating an Audio class (adapted from Apple’s aurioTouch example project) that uses C++. The base class imports the Audio class’s header, and then initializes an Audio object so that I can call methods within the Audio class.

When I compile, I get errors like “expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute‘ before ‘!=’ token” in the Audio class and its helper classes, because the compiler is tripping over the C++ syntax. If I change the extension of the base class to .mm I get the same errors; I think I will have to also change the extension of all the classes that inherit from the base class.

Is there a way to avoid this? In other words, how can I compile just the minimum amount of files as C++ — ideally just the Audio class, or the Audio class and the base class — without changing the rest of the project?

The reason I ask is that this bit of audio is about .5% of the app’s functionality, and it seems wrong to change dozens of files to compile differently just because of this one small addition.

  • 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-24T07:28:09+00:00Added an answer on May 24, 2026 at 7:28 am

    It should actually suffice to rename the .m file that uses C++ functionality to .mm. You have to make sure that you don’t include any C++ headers in the header file of your class, otherwise the other non-C++ classes will go berserk trying to include your class’s header file.

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

Sidebar

Related Questions

We have many projects that use a common base of shared components (dlls). Currently
I have a Qt/C++ project and an old VB6 project. The user base might
I have project that I'm working on that is going to require a webserver.
I have a project that I'm currently working on but it currently only supports
I have a project that I would like to start beta testing soon, it
I have a project the requires the use of the exec family. My project
(By the way, I don't use Interface Builder) I have a little project consisting
I have a simple class that provides state codes like this: public class StateProvider
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a project where I would like to generate a report export in

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.