Importing the complex.h header file into the Xcode.c header file causes compilation errors

I have a project containing a mixture of Objective c and c files. In one of the c header files, I'm trying to import complex.h. Xcode generates 13 compilation errors related to NSObjRuntime.h:

NSObjRuntime.h

Problem with parser. Expected identifier or '('

Parser Problem Unknown type name "NSString" ...

Additional compilation errors are generated from NSZone.h.

It seems to me that errors arise from Objective-C code that is not recognized in the .c file. Should I convert my c files to a c object in order to import complex.h or is there a more elegant solution?

+3
source share
1 answer

, Objective C, .c.

.

c c complex.h ?

objc . objc. complex.h objc.

objc c-.

, :

#if defined(__OBJC__)
#import <Foundation/Foundation.h>
#endif

, , include. , #if defined(__OBJC__).

+3

All Articles