Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22153

clang / gcc on MacOS: Error Expected Filename [closed]

$
0
0

I've just got clang running on my Mac 10.14.6, trying to run a simple HelloWorld program but I'm struggling to import/include the function library... See code below. Any help much appreciated - mega n00b alert. Isn't Mr. Robot great though.

Here's my code:

#import <stdio.h>int main(void)    {printf("Hello, world!\n");return 0;}

and here's my error:

Michaels-MBP:tests mh$ gcc hello.chello.c:1:8: error: expected "FILENAME" or <FILENAME>#import       ^ hello.c:4:2: warning: implicitly declaring library function 'printf' with type'int (const char *, ...)' [-Wimplicit-function-declaration]        printf("Hello, WOrld!\n");        ^hello.c:4:2: note: include the header <stdio.h> or explicitly provide a      declaration for 'printf'1 warning and 1 error generated.

Viewing all articles
Browse latest Browse all 22153

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>