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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:24:30+00:00 2026-05-25T10:24:30+00:00

I need to use C++ file in my project, it’s called CAXException.hpp , and

  • 0

I need to use C++ file in my project, it’s called CAXException.hpp, and row in project targets “Compile Sources As” – “According to file type” not Objective-C++. But when it’s compiling it always displays me error error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CAXException'
in code:

class CAXException //<-------error here

{}

Please help me to fix it..

  • 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-25T10:24:31+00:00Added an answer on May 25, 2026 at 10:24 am

    If I understand you correctly, you have a C++ header file (.hpp) that you want to include from Objective-C file. Unfortunately, you can’t do that directly. You’ll have to use a workaround.

    The easiest is to change the compilation option of each and every Objective-C file (.m) that include this C++ header file (either directly or indirectly) to be compiled as an Objective-C++ file. This can be done either by renaming the files to .mm extension or by changing the option for the compiler for the file.

    If this work for you, this will be the easiest, however Objective-C++ is not a complete superset of Objective-C (as C++ is not a superset of C), and some valid Objective-C is invalid Objective-C++ (if C++ keywords are used as variables names).

    If this happens, you’ll have to create an Objective-C wrapper to the class, with an implementation in Objective-C++ that simply delegate to the C++ class. That is create an CAXExceptionWrapper.h Objective-C file, containing something like:

    @interface CAXExceptionWrapper {
      @private
        void* _CAXExceptionImpl;
    }
    - (id)init;
    // ...
    @end
    

    And an `CAXExceptionWrapper.mm’ Objective-C++ file containing:

    @import "CAXException.hpp"
    @implementation CAXExceptionWrapper
    - (id)init {
        if ((self = [super init])) {
            _CAXException = new CAXExceptionWrapper;
        }
        return self;
    }
    // ...
    @end
    

    And then in your Objective-C files, include the wrapper Objective-C header instead of the C++ header.

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

Sidebar

Related Questions

I need to use .htaccess file to replace a word in a URL; something
I was following this tutorial . I need to use a php file's ouput
when you need to use a function you include a header file but wheres
I have a xsl file where i need to use parameters from an external
When I need buffered IO on blocking file descriptor I use stdio. But if
I need to parse a file in TSV format (tab separated values). I use
I need to read a BufferedImage from file, which doesn't use DataBufferInt (as normally),
I have a fixed-length data file need to persistence into database. I use a
I am need to parse a pdf file. I would like to use objective-c
Trying to use GnuPG with Delphi (Win32). I need to sign some file with

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.