I use Linux Ubuntu and when I try to a compile a simple C program that prints something on the screen using
#import<stdio.h>
I get this error
#import is a deprecated GCC extension.
How am I supposed to resolve this error?
I use Linux Ubuntu and when I try to a compile a simple C program that prints something on the screen using
#import<stdio.h>
I get this error
#import is a deprecated GCC extension.
How am I supposed to resolve this error?
From GCC's CPP documentation:
CPP supports a variant of ‘
#include
’ called ‘#import
’ which includes a file, but does so at most once.
You can safely replace #import
by #include
if you make sure the file referred to is using so called "header-guards".
So the 1st two lines of the file to be #include
d should look like
#indef SOMETHING_UNIQUE_IN_THE_CONTEXT_OF_YOUR_PROJECT
#define SOMETHING_UNIQUE_IN_THE_CONTEXT_OF_YOUR_PROJECT
then 0 to many lines
/* C stuff here */
and finally the last line should be
#endif