Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems with #pragma interface



I'm tring to port a large C++ program to MacOS X 10.2, and I discovered
a bad interaction between the "interface" pragma and abstract methods.
For example, here is a trivial C++ header file:

	[cheetah:~/tmp] jhr% cat t.h
	#pragma interface

	class Foo {
	public:
	  virtual void m () = 0;
	  Foo();
	  virtual ~Foo();
	};

and a C++ source file that uses it:

	[cheetah:~/tmp] jhr% cat t.cxx
	#pragma implementation

	#include "t.h"

	Foo::Foo () { }

If I try to compile t.cxx, I get the following error message:

	[cheetah:~/tmp] jhr% c++ -c t.cxx
	t.h:3: storage size of `_ZTI3Foo' isn't known

but if I comment out the "interface" pragma in t.h, then the example
compiles.

Is this a known bug with gcc 3.1, or is it a feature?

	- John
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.





Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.