6

I have some classes that use the new @import module directive and it works fine in my non-workspace project but once I move those files over to a project in a workspace I get the error Unexpected '@' in program similar to this question: @import "Unexpected '@' in program" However I DO have Enable Modules build settings ticked to Yes. The static library in my workspace project also has this option enabled. I tired cleaning the build as well with no luck. Are there any other settings I'm missing?

Community
  • 1
  • 1
Steve Moser
  • 7,647
  • 5
  • 55
  • 94

2 Answers2

3

Make sure you have ticked the enable modules in both your project and target of your static library and main project.

Joel Fischer
  • 6,521
  • 5
  • 35
  • 46
3

Are you using Objective-C++? @import does not work in .mm files.

IngmarStein
  • 650
  • 6
  • 12