I have project which is written on Swift but some part of project is written on Objective-C++ for integration with C++ library. My .mm files don't see Swift classes. I have done all steps from Can't use Swift classes inside Objective-C but still can't fix it. Auto-generated "project-Swift.h"
generates with errors. I've tried to delete pieces of code in which error occurred and it worked well, but this "project-Swift.h"
regenerates every time when I clean the project. Here is screenshot with errors link. Thanks.
Asked
Active
Viewed 49 times
0

Bohdan Savych
- 3,310
- 4
- 28
- 47
-
It looks like you're missing `@import "AppKit.h"`. Have you included `import AppKit` in the Swift code? Alternately, you've created a circular dependency. Do you have an ObjC header file that imports `project-Swift.h` and is itself included in the bridging header? That's not legal. – Rob Napier Jul 13 '18 at 15:45
1 Answers
2
This looks like you're not including the headers that define the missing symbols, like NSViewController
, before including your bridging header.

Gereon
- 17,258
- 4
- 42
- 73
-
Sorry for maybe stupid question, but, what you mean by "before including your bridging header."? Where I should include that? – Bohdan Savych Jul 13 '18 at 18:13
-
Add the missing include/import Statement directly above your current `#import "project-Swift.h"` line. – Gereon Jul 14 '18 at 10:40