• 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
Mixing C++ and Obj-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mixing C++ and Obj-C


  • Subject: Mixing C++ and Obj-C
  • From: James Pengra <email@hidden>
  • Date: Sat, 16 Jan 2010 10:53:02 -0800

In an effort to work with Core Audio I want to write a Cocoa program that includes C++ classes. As a test I included the following simple class in my Cocoa program:

The header is:

class Calbak
{

public:
	Calbak();
	virtual ~Calbak();

	int	MyCallBack( int var1, int var2 );

};

The .cpp file is:

#include "Calbak.h"

Calbak::Calbak()
{
}

Calbak::~Calbak()
{
}

int Calbak::MyCallBack( int var1, int var2 )
{
	return var1;
}

When I build the program, it rejects the first statement in the header "class Calbak" saying that it expected some symbol or attribute before 'Calbak'.

Can anyone tell me what's wrong with this, or point me to documentation for mixing C++ and Obj-C classes.

 Thanks, Jim
_______________________________________________
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: Mixing C++ and Obj-C
      • From: Dave Carrigan <email@hidden>
  • Prev by Date: Re: Which files are unused?
  • Next by Date: Re: Mixing C++ and Obj-C
  • Previous by thread: Re: Breakpoints
  • Next by thread: Re: Mixing C++ and Obj-C
  • Index(es):
    • Date
    • Thread