Hi all,
I’ve built a class with a header file and a Obj-C++ .mm file. Like this:
Foo.h
#pragma once
#ifdef __APPLE__
class Foo
{
public:
Foo(void* windowHandle);
bar();
private:
void* handle;
};
#endif
Foo.mm
#include "Foo.h"
#import <Appkit/Appkit.h>
Foo::Foo(void* windowHandle) : handle(windowHandle) {}
Foo::bar() {
// do some stuff with NSWindow like
NSView* nsView = (NSView*)windowHandle;
NSWindow* nsWindow = [nsView window];
NSAppearance* appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantLight];
[nsWindow setAppearance:appearance];
// ...
}
This is working fine and everything is linking correctly. However, as soon as I’ve trying to put this in a user module, I got some linking errors.
When leaving #import "Appkit/Appkit.h", Xcode is telling me Expected unqualified-id for NSObjCRuntime.h
NSZone.h
NSObject.h
…
And a lot of Unknown type name 'NSSString'
When I comment out #import "Appkit/Appkit.h", Xcode is complaining not knowing NSView, NSWindow and so on…
So what am I missing when creating a user module including .mm files and using Appkit symbols?
I’m sure it’s a stupid one …
Thanks,
Stefan

, thanks McMartin, as suspected this was a really stupid one from me.