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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:37:13+00:00 2026-05-21T03:37:13+00:00

I have a c++ class IPoint and want to use an instance of IPoint

  • 0

I have a c++ class IPoint and want to use an instance of IPoint as an instance variable for an obj-c class.
But when compiling it gives me the error: “expected specifier-qualifier-list before ‘Ipoint'”
However I have included the desired header that is “IPoint.h”.

But when I use the cpp object in my class just by initializing it without making it an instance variable, it works.

There is a specific requirement of the cpp object to be stored as instance variable since it is required further in my project, if there could be a way to make it work like writing a wrapper for the object or anything else.
kindly help me out!

  • 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-21T03:37:14+00:00Added an answer on May 21, 2026 at 3:37 am

    If you want to be able to #import your Objective-C class interface into both Objective-C and Objective-C++ code, you can use an #ifdef to declare the instance variable as void* for the former:

    @interface MyClass : NSObject {
        #ifdef __cplusplus
        IPoint *point;
        #else
        void *point;
        #endif
    }
    

    Unfortunately, this does mean you’ll need to manage the lifetime of the C++ object manually, creating and destroying it with new and delete in your Objective-C++ init and dealloc methods, respectively.

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

Sidebar

Related Questions

I have class Student , I want to create multiple instance of class Student
I have class method: public object MyMethod(object obj) { // I want to add
In my business model I have Entity class (IPoint interface ) that has a
I have class, that selects the ItemDataTemplate for objects. But I can't reference it
I have class and I want to reproduce the functionality associated with ToString(0.0000) as
I have class Foo class Bar Now, I want Foo* Foo::singleton = new Foo();
I have class EventManager with method: public function addEvent(obj:IEventDispatcher, event:String, listener:Function, useCapture:Boolean = false,
I have class that is derived from FrameworkElement , and I want WPF to
I have Class and Student objects. Both have collection of another as property. Which
I have class LegacyClass which inherits OldBaseClass. I'm considering a change to introduce a

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.