"FILE" identifier undefined in C - MacOS 12 #8868
Replies: 3 comments 4 replies
-
Can you run C/C++: Log Diagnostics and check if the compilerPath and system includes are as expected? |
Beta Was this translation helpful? Give feedback.
-
@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. |
Beta Was this translation helpful? Give feedback.
-
I quickly fixed by just updating gcc via terminal, I guess something just went wrong during the update from MacOS 11 to 12. |
Beta Was this translation helpful? Give feedback.
-
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);
}
}
Beta Was this translation helpful? Give feedback.
All reactions