"FILE" identifier undefined in C - MacOS 12 #8868
Unanswered
Gabriel (gbartuccio)
asked this question in
Q&A
Replies: 3 comments 4 replies
|
Can you run C/C++: Log Diagnostics and check if the compilerPath and system includes are as expected? |
4 replies
|
Gabriel (@gbartuccio) Could you also get logs of the language server by following the instructions at https://code.visualstudio.com/docs/cpp/enable-logging-cpp#_enable-logging-for-the-language-server? These logs may show if IntelliSense is crashing or when it fails to work. |
0 replies
|
I quickly fixed by just updating gcc via terminal, I guess something just went wrong during the update from MacOS 11 to 12. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I wanted to use the FILE structure which is included in stdio.h, but the "FILE* fp" doesn't get recognized, saying that the "FILE identifier is undefined". Im running VSCode on MacOS 12.2.1 M1, gcc installed via Homebrew.
#include <stdio.h>
#include <stdlib.h>
main(){
char c;
FILE* fp = fopen("prova.txt","w");
if (fp==NULL) exit(1);
else {
while ((c=getchar())!=EOF)
fputc(c,fp);
fclose(fp);
}
}
All reactions