> I implemented (experimental) precompiled headers support in gnustep-make.

Unfortunately, with my compiler (4.1.1 20070105 (Red Hat 4.1.1-51)) I can't get
precompiled ObjC headers to work. :-(

It works fine for C headers, but it doesn't seem to work for ObjC headers.

In attach a couple of files, test.h and test.m.

If I compile them the standard way --

 gcc test.m -lobjc

it all works.

If I first precompile test.h

 gcc -x objective-x-header test.h

I get the test.h.gch file, which looks ok, but then compiling fails --

 gcc test.m -lobjc

test.m:4: warning: cannot find interface declaration for �TestClass�
test.m:4: error: redefinition of �struct TestClass�
(compilation aborts)

Using the -H option to gcc you can indeed confirm that compilation fails iff the
precompiled ObjC header is used.

It seems that ObjC class declarations in ObjC headers are not read correctly/at 
all from precompiled headers (C stuff works fine instead!).  Very 
disappointing. :-(

Am I missing some GCC option ?  It's late night. ;-)

Thanks
/* Contributed by Nicola Pero - Tue Jan 16 04:09:06 GMT 2007 */
#include <objc/objc.h>
#include <objc/Object.h>

@interface TestClass : Object
+ (int) test;
@end
#include "test.h"

@implementation TestClass
+ (int) test
{
  return 0;
}
@end

int main (void)
{
  return [TestClass test];
}
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to