5

This came up for me when I tried to integrate AdMob using Cocoapods into an Objective C++ project.

use of '@import' when c++ modules are disabled, consider using -fmodules and -fcxx-modules

What is this error and how do I fix it?

bobobobo
  • 64,917
  • 62
  • 258
  • 363

2 Answers2

6

Fix is easy, you have to do what the warning says and not only enable C and Objective-C modules but also C++ modules.

So you must add the compiler flag -fcxx-modules to "Other C++ Flags" in your Build Settings

bobobobo
  • 64,917
  • 62
  • 258
  • 363
0

Try this:

  1. Open Build Settings tab under TARGETS
  2. Search GCC_INPUT_FILETYPE
  3. Check the value of Compile Sources, change the value to According to File Type if it's not
Story5
  • 142
  • 1
  • 1
  • 9