GCC/ G++ "no such file or directory" error even afer settings the right path, fixed!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back to my channel and today i am going to show you how to resolve the gcc compiler error of no such file or directory now i wanted to make this video because this error was annoying me for nearly two months and it's a very common error and it's very easy to solve so i thought i should share it with others now if you are here to watching this video thinking that i will tell you how to set the path so i suggest you to watch other videos on youtube because here i will only tell you about the error which you are getting even after setting the right path so let's get started okay so first things first whenever you open your visual studio code and if you are not getting this window by default here terminal debug console output problems if you are not getting this just go to terminal and click on new terminal you will get this and after that see here see user's admin means my terminal is targeting at my admin folder means this folder and my test.c is on desktop so whenever i will try to compile it it will show me the error no such file or directory it's obvious because it's trying to compile it and find it in this folder but it's not there it's here on the desktop so the work around for it is you can just cut it and simply paste it here now it's still on desktop so just close it and open it from here now if you will try this it won't show any error but still the problem remains that you are not getting any output so the problem here is that gcc or g plus plus whatever you're using it's not any runner or something that will run your program it's just a compiler it will just and just compile your program the running is in your hand so to compile it write gcc then dash o after that write the name which you want to give to the exe file this gcc will make like let's say a n s w e r i will give it that file name answer and what is the c file name it's test dot c it's done now if you go to that folder and just see here we are given him the name answer and here it is the name answer and the executable file now if you want to run it here just type dot forward slash and the name of the exe it will run but then if you will ask me why and how i can run the programs that are saved in another folder or somewhere else for this you have to go to visual studio for just delete it and see here it is see user's admin let's say you want to open some open some file from d folder so just click on open folder and select d and open it now see here you have the d file here open now if you will run your terminal see your terminal is targeting at d so if you want to run any other files from any other folder you will have to open that folder from here or else it will always always be targeting on your default folder like see windows system 32 or your admin folder now after that what if you want to run it directly like you will say i don't want to compile it and then i am not comfortable with so many codes like dot and slash etc so you can always go to extension and download the code runner now i don't internet but here if you will write the code runner you will get see this this extension you can install it now if you will open the folder again i will just open the folder of my admin and just select it now go here and we had that test.c here now after installing the code runner you will see here this play button if you will click it it will just automatically compile it and run it for you once and for all see but for this to work you will always have to keep in mind that you will have to see which folder your terminal is targeting at first set that folder then you can always use this whenever you want and now if you ask me why i didn't told you about this at first it's because how it works now you will know it will just do what i did for the first time it will compile it then run it now if you would have wouldn't have known how this worked if something had happened you wouldn't have able to solve it so i first told you how this works and then i told you about this so i hope you understood what i was trying to say sorry for my english i am basically introvert and it's uncomfortable for me to say so many things like i'm saying this for the first time in my life so i hope i hope you have understood if you have any problem just comment it down here about this video and i will try to solve it in the comment if i can thank you for watching
Info
Channel: Naresh Sharma
Views: 244,601
Rating: undefined out of 5
Keywords:
Id: LuU7KOLDHXo
Channel Id: undefined
Length: 6min 49sec (409 seconds)
Published: Tue Feb 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.