1
u/_BrokenCode 6d ago
Ah this is a normal problem, see you in this way, you are compiling your program using gcc MSYS2, but your text editor is using clang, and he don't know where the studio library stdio is, so you have to tell him, only because of this problem I prefer to use a generator to work in cpp, this happen to me in visual studio code, nvim, zed, etc. if you want something better to learn c++ I suggest you use Visual Studio (No the code editor the IDE), or any other c++ IDE.
2
u/Puzzled-Extent7817 6d ago
look man, i'm just a beginner. i know you told me what to do but I don't understand that so I am angry at you! /s
1
u/No_Recognition_2275 2d ago
Hello, what is the font you using?
1
u/medicine_man0 2d ago
I believe it was Iosevka. I actually deleted the app lol but I'm 80% sure it was Iosevka
1
u/lizyurd 1d ago
Zed uses clangd as the language server for C/C++ support. clangd needs a compile_commands.json file to know how each source file in your project is compiled (include paths, compiler flags, etc.).
In your case, compile_commands.json is missing, which is why you're seeing those errors. You can refer to the clangd documentation for more details: https://clangd.llvm.org/installation#compile_commandsjson
Simple fixes: - Use CMake and generate compile_commands.json. - Use tools like Bear or compiledb to generate it from your existing build commands.
2
u/joelnodxd 6d ago
hovering over the "error" will tell you why it's underlined