For people who get an error: "make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program." Do this: 1. Make sure you've got MinGW installed. 2. Add MinGW to your system path. 3. Instead of "make" use: "MinGW32-make"
Nice. I'm a non-ide kinda developer and found #1 & #2 tutorial very helpful getting a compile to work in VS. Instead of editing the Makefile SRCDIR, you can also drag/drop the main.cpp into the src directory and then complie/run.
@Domingo Goyena - Glad it was helpful! Yes, good mention you could simply leave it in the root/base directory and it will successfully compile. The only reason I did was for a little bit of structure =)
Took two semesters of c++ maybe eight years ago, so it feels good to brush off the cobwebs and re-learn the basics. This is, jeez... it's in the double-digits how many times I've tried to sit down and learn to code, only to let it slide. Let's hope this one sticks...
what if I send these file to another computer, when they do not use the same path for example in your case is /home/savvynik/...///... in my case savvynik can be different name.
Also having the same g++: fatal error: no input files and can't figure out why there is .cpp file after -Wall and before -o test. Kept redoing the tutorial from scratch and can't put my finger on it. Edit: It was as simple as making sure your directories and file names have no spaces at all. Problem solved!
So loving your content and am glad i ran into your channel. I would love to know if running g++ name-of-file.cpp -o nameOfProgram the same as running make according to your video.
Hey! I've tried to do the same on Win10 but failed. Is there any instrument for Wn10 that can do the same? How to configure this extention for WIn10? Thanks!
@SavvyNik i get problem when i make MakeFile i shows: g++ -std=c++11 -Wall -o Tera g++: fatal error: no input files compilation terminated. Makefile:36: recipe for target 'Tera' failed make: *** [Tera] Error 1 help..
@Mandeep singh - I'm not sure how you have your makefile setup. If you followed the steps you should have VSC generate a makefile for you. All your cpp files should be located in a "src" folder and that's where the generated makefile will look at and compile every cpp file it finds. The compiler is telling you that there's no cpp files specified to compile. Meaning g++ -o . To me it looks like you have a switch called -Wall which I'm not sure what that does but then you have an output file called Tera yet you don't have any cpp (objects) specified to be compiled in front of that.
@@ermacellaio1657 - Is there a reason you're trying to include these two header files? I assume you're trying to create your own code and not following the series because these two are not referenced.
I assume you installed the make binaries somewhere on your computer. You will need to add the directory where the binaries are located to your environmental path and that should be it.
@@SavvyNik You are magical! It works beautifully. I was building a C++ project in which I have 3 separate files: the header file, the implementation file, and the client file, and I was not able to get it to work until I watched this video and downloaded make. Many thanks! I will be watching your videos more often.
Hey I just had a quick question. For some reason bash doesn't recognize make as a command; I made sure that the extension was enabled but still nothing. Is there anything I can do to resolve this. Thank you and this video was really informative.
@David Martinez - No problem, that's interesting. I'm wonder if you're missing a package which comes standard with most linux distributions called "build-essential". Are you using some linux distro? And you're sure you navigated to the project where a "makefile" file is located before running make? Those are the few things I could think of =)
I getting this error: gcc -std=c11 -Wall -o test gcc: fatal error: no input files compilation terminated. make: *** [Makefile:36: test] Error 1 As I'm beginner to coding and VS Code, I'm totally lost seeing this. Could you please help?
This -> gcc -std=c11 -Wall -o test is wrong. There needs to be a file before the -o that will get compiled into a file called test. For example: gcc -std=c11 -Wall main.cpp -o main
I don't personally have one. Mainly you would want to install make and build tools on windows put them in your env path and then you should have a similar process.
@@SavvyNik Thanks a lot for your reply ! tbh that is what I have been trying to do, could you kindly link me to where I could download 'make' from, I have tried GnuWin32 and updated Path to the \bin folder, After that, the Command Line recognizes 'make' as I use it. But, when it comes to building project, as you have shown in the video, it just gives me a bunch of errors, I know that comments are not meant for troubleshooting, etc. However I would really appreciate if you could point me towards the right direction in this case. Thanks a lot, very helpful video, you got a sub.
UPDATE: Never-Fn-Mind, it works perfectly on windows, I did literally nothing different on windows, I went back and read more about make files and made my own simple make files and played around with it and I realized it gives an error if I have more than one Make file even in a subdirectory where I have opened my project folder in VS Code, which was my issue, so went back and created a new fresh folder and did the exact steps you did on Linux on my Windows 10 Machine and it works perfect ! P.S I ended up installing Chocolaty from shell and used that package manager to install make, make.exe is now integrated to all my terminals but I am not sure where exactly the file is at but Chocolaty gives a log to find it after you install 'Make' if you want. I am really excited to start creating folders and organise my header and implementation files on VS Code as its my Favourite, really thank you so much !
@@ahmedifhaam7266 Haha I was about to reply. I'm super glad you got things working! Congrats, no problem, and glad I could help. Hopefully you continue following the channel and make sure to smash that like button for me if you haven't already. Good luck coding :D
Hi, can u plz make a video on building C/C++ jobs through GitHub to Jenkins . Along with Static code analysis and code quality and Unit test as part of CI process.
@Aravind Doss - As long as you have some version of C++ installed and it's available to your environmental variables (windows) or ld_library_path (linux) then the system should have access to the proper libraries and be able to access them. gcc.gnu.org/install/binaries.html
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + make + ~~~~ + CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException Does anyone get this error help
Your windows machine doesn't have make installed on it. I assume you don't have the gcc tools either. You'll have to install make and add it to your environmental variables path. Here's a vid for gcc - ruclips.net/video/hCLIDph7-mU/видео.html
thanks for replying. I did install MingW before but i found out in the bin folder, there's no make.exe file so i have to create one by copy from mingw32-make and it worked out
in the ".c" file if I set cursor on any variable, and type F12, cursor go to the define of this variable. In the Makefile this is not work. How to make Makefile F12 work similarly?
@Vitaly Lev - Are you sure you don't have an extension that only applies that rule for c/cpp files because it's a c++ extension? Variables are defined differently in a makefile because they don't follow the same programming syntax as c++. It has it's own unique structure.
@@SavvyNikhi Savvy! thanks for quick answer! I understand that C and makefile have different syntax. and F12 works fine in C files. and it would be extremely useful if F12 worked similarly in a makefile. if you know how to do it, please help.
@@vitalylev - I'm not sure how to make it work. Maybe someone else has some insight on this. Can't say I've really tried. Also what are you editing inside the makefile? Usually it's just used to build a project and it should be able to handle multiple object compilation as long as it's all in the src folder.
@@SavvyNik I work with compiled projects that have hundreds of files. i have to work with several makefiles that are in different directories. the first makefile causes the second, the second can cause the third, and so on. and already in the second it is absolutely not clear what the variables which are not described in this second file mean. and besides, I didn't write those makefiles. therefore, it would be very useful to be able to press f12 to quickly see the definition of a variable. this is very important. this could be done through the json file. but I can't. example: "[makefile]": { "key": "f12", "command": "actions.find" }, actions.find - for example. not work.
@@vitalylev - You got a pretty big project! I could see how it could be helpful for you. I don't know of an extension for makefile that can help with some form of intellisense. Looks like there's a project ready for someone to tackle =)
hey idk if you will see this message but i keep getting an error where is says make is not recognized as a name it says check either the spelling or the path, but im sure i spelled make correctly, please help if you somehow see this
@@CrunchPasta You'll need to install make in order to use it on Windows and if you already have make sure that the environmental path is updated so your system knows where it is located. www.gnu.org/software/make/
Hi Savy. Great explanation. It is really helpful. I have one query . If we have multiple files and libraries linked with the project and we have CmakeLists.txt file with all the relationships defined.. Hope to create Makefile for that. Hoe to basically work with CmakeLists.txt file in VS CODE. THANKS in advance.
Glad you enjoyed the video. I don't normally use make lists. Here's an article on what seems to be a guide for creating a project with cmakelists on Linux with VSCode: code.visualstudio.com/docs/cpp/cmake-linux
Thanks for the awesome video! Just one question. Under the SRCDIR path in the make file, do I have to type /home/name/projectfolder? Or can I type ~/projecfolder to make it simpler?
No problem, glad you enjoyed it and make sure to smash that like button for me on the vid if you haven't already. I like to stick with absolute paths so the system has no chance of getting it wrong. I'm not sure if it knows the alias for ~ I would assume it does because it runs Linux, but you never know when a certain symbol is not allowed. Great question.
SavvyNik ok I’ll keep that in mind. I was just wondering in case I ever moved the project to a different computer. And thank you for the quick reply! Glad I found you videos and love your channel so far! Keep up the good work!
Got a problem g++ -std=c++11 -Wall -o test g++: fatal error: no input files compilation terminated. make: *** [Makefile:36: test] Error 1 help I've been trying so long to compile multiple files just to make one program from C++ tutorial :d
Hello, I'm doing a C++ project using this makefile extension but in my project I need to do a composition of classes, so I need to include a class1.h in my class2.h file, but when I 'make' in the terminal I get an error that the class2 didn't found class1. Maybe I need to change some makefile configurations but I don't know how to do it, can you help me?
As long as you have everything in the src folder the makefile scans all files and compiles anything that has been included. Make sure you've included your files properly among the various headers that you have and it should take care of itself. Otherwise keep watching the series because we do use classes with the exact thing you are suggesting.
@Mariam Albarghouti - You'll have to download make and install it for windows. Here's the official website: gnuwin32.sourceforge.net/packages/make.htm They have an executable you can download the option called "Complete package, except sources" for the windows exe setup.
@@RowanPlayZ - You ran through the installer and then restarted your computer? Just make sure you are in the proper directory before issuing make. A makefile must exist in the directory.
@@SavvyNik Hello, I installed "make", restarted, and i opened terminal in the same directory as the .cpp and makefile. I get an error: The term 'make' is not recognized. Could you help me please? I have been trying to run C++ and compile it, following different tutorials... but everytime i get this same error " " is not recognized. running win10 Thanks
After installing vs code, I was able to use makefile created by Makefile project. Then it won't create makefile in another directory. Anyone knows what happened?
Hello Nik, Nice explanation! Query: If I created folder "TrialProj" under SIMPLELIST, when I do make all files get created in Parent folder is it any way to select particular folder to create Make files. Thanks in advance :)
@@SavvyNik yes that I understand, but is there any way when we give make command folder will get generat (src, obj, Make) into sud directory instead of parent directory?
@@nileshwalhekar6165 Ahh you want generate compilation in multiple directories/folders. Yes there's a way, but it's not simple to explain. You would have to modify the makefile to do this. Here are some examples: stackoverflow.com/questions/1139271/makefiles-with-source-files-in-different-directories riptutorial.com/makefile/example/21376/building-from-different-source-folders-to-different-target-folders
@SERO - Sure use a while loop and check for a condition or just do: while(1) { //your statements } That'll make an infinite loop and keep executing whatever is inside or you can use a sleep if you use #include then sleep(3) - that would sleep for 3 seconds. What are you trying to accomplish w/o your program closing immediately? Do you want the user to select an option to quit? If you keep watching the series I actually show a function that does just that.
@@dera0374 - Ahh well a cheap way to do that then is to use cin >> someVariable; That will force the program to have to wait for an input from the user before continuing and all you need to do is define someVariable like int someVariable; of course it won't matter what you're supplying to the terminal you could just press enter to continue, but I think that would give you the result you are looking for =)
Download a 25 page Linux Checklist here - learn.savvynik.com New to C++? Start learning the Basics here - @JxUE (with 30+ videos!!) Episode #3: ruclips.net/video/PT6Nxwpeckw/видео.html Here's the code if you need it (Repo) - github.com/SavvyNik/SimpleList
Not so helpful for people using windows. Guess I'll have to spend a $1000 on a mac so I can just freaking get my university projects done with ease AT LEAST...People keep saying how amazing Visual Studio is. IT SUCKS....It can't even do large projects and only runs one .cpp file....
Why couldn't you use a makefile on Windows? There's options to install Make on Windows as well. Worst case don't bother spending extra money purchasing a Mac when you could install a Linux operating system for free.
@@SavvyNik I was able to solve it by simply using g++ *.cpp to compile everything. I have a question though. Why is my terminal opening outside vscode? I want it like yours and many others who have it embedded within vscode..how do I do that? I can't find a single video over that..
@@TheGreatKhan well that's great. Didn't realize you could do that lol. Thanks for sharing. I'm not sure why your terminal is opening outside of vscode. That's not the default function. You should be able to go to view->terminal inside vscode and that should launch a terminal inside vscode. code.visualstudio.com/docs/editor/integrated-terminal
SavvyNik Don’t worry about that! Got it fixed. Had to turn the contpy off. But yes google should seriously include g++ *.cpp for everyone out there to see lol
My NEW in depth C++ Course is now available at - learn.savvynik.com/
beginner in C here struggling with assignments for creating a make file. I'm so glad I found your video! thanks so much!
You're so welcome!
For people who get an error: "make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program."
Do this:
1. Make sure you've got MinGW installed.
2. Add MinGW to your system path.
3. Instead of "make" use: "MinGW32-make"
Thanks for the mention and if you need help installing MinGW on Windows make sure to check out ruclips.net/video/hCLIDph7-mU/видео.html
thanks!, But then I get this error: g++: fatal error: no input files
you literally saved my life, thanks!!
THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
You saved me after 2 weeks of trying to write a generic makefile from scratch and hours and hours of debugging
Awesome to hear!! Glad it worked out for you. Make sure to destroy that like button button for me ^^
Aaaaand the saviour of the day is SAVVYYYYNIKKKKK !!
Haha glad you found the video helpful =)
You got a new subscriber, it's amazing how easy you explain everything!
@Joaquin Ortiz
- Awesome!! I'm glad your following and thanks for the kind remarks it means a lot!! =)
this dude makes stuff simple ...thanks budd
You're welcome! Glad to help.
here's a tip, to copy from terminal most common is Ctrl+Shift+C and paste on your VSCode using Ctrl+P and to paste in terminal use Ctrl+Shift+P
@AvishekPD's YouThoob - Thanks ^^
Nice. I'm a non-ide kinda developer and found #1 & #2 tutorial very helpful getting a compile to work in VS. Instead of editing the Makefile SRCDIR, you can also drag/drop the main.cpp into the src directory and then complie/run.
@Domingo Goyena - Glad it was helpful! Yes, good mention you could simply leave it in the root/base directory and it will successfully compile. The only reason I did was for a little bit of structure =)
Thank you for this helpful content
No problem, glad you found it
Took two semesters of c++ maybe eight years ago, so it feels good to brush off the cobwebs and re-learn the basics. This is, jeez... it's in the double-digits how many times I've tried to sit down and learn to code, only to let it slide. Let's hope this one sticks...
Good luck! =)
thank you :-) it's helpful
Omg, i searched for this for so long. You should rename the video in something like makefile for vs code multifile project. Cause it is not obvious.
Well glad you found it haha! Yeah maybe that's not a bad idea. Not sure why I named it this way anyway lol. Thanks for the suggestion.
Thanks so much! Now I can move forward with intro to programming class!
Awesome to hear! No problem. Make sure to destroy that like button for me if you haven't already =D
what if I send these file to another computer, when they do not use the same path for example in your case is /home/savvynik/...///... in my case savvynik can be different name.
Man you're more than awesome. Thanks.
Well thanks for the kind remarks!! No problem. Make sure to smash that like button on the video for me if you haven't already =)
Thank you for the amazing work!!.
You're welcome!! Glad you found it helpful and make sure to smash that like button for me if you haven't already =)
Very good presentation !
Thanks. Gland you enjoyed it!
The Makefile extension doesn't work anymore :((((
Thanks for letting me know. I'll have to check and see what's up with that.
very useful, thanks much!
You're welcome!
thank you, it's a clear explainig
@ahmed guetat
- No problem, glad you found it helpful!! If you haven't already make sure to hit that like button for me on the video =)
Also having the same g++: fatal error: no input files
and can't figure out why there is .cpp file after -Wall and before -o test. Kept redoing the tutorial from scratch and can't put my finger on it.
Edit: It was as simple as making sure your directories and file names have no spaces at all. Problem solved!
Glad you got things figured out and didn't give up! Awesome job.
So loving your content and am glad i ran into your channel. I would love to know if running g++ name-of-file.cpp -o nameOfProgram the same as running make according to your video.
Glad you found the channel! New updated & recreated videos on this series coming soon :)
THANK YOU MY GUY ThIS HELPED ME
@first name last name
- Glad it helped make sure to go ahead and smash that like button for me if you haven't already on the vid =D
Hey! I've tried to do the same on Win10 but failed. Is there any instrument for Wn10 that can do the same? How to configure this extention for WIn10? Thanks!
i love u so much thanks for this tut 3>
@hASSAn kAMEl - Glad it was useful =) no problem!! I'm dropping another episode really soon ^^
nice work. champ
Glad you enjoyed the video! Make sure to smash that like button for me if you haven't already =)
@SavvyNik i get problem when i make MakeFile i shows:
g++ -std=c++11 -Wall -o Tera
g++: fatal error: no input files
compilation terminated.
Makefile:36: recipe for target 'Tera' failed
make: *** [Tera] Error 1
help..
@Mandeep singh - I'm not sure how you have your makefile setup. If you followed the steps you should have VSC generate a makefile for you. All your cpp files should be located in a "src" folder and that's where the generated makefile will look at and compile every cpp file it finds. The compiler is telling you that there's no cpp files specified to compile. Meaning g++ -o . To me it looks like you have a switch called -Wall which I'm not sure what that does but then you have an output file called Tera yet you don't have any cpp (objects) specified to be compiled in front of that.
I have the exact same output
@@ermacellaio1657 - If you try cloning my repo and building it with make do you still have the same issue? github.com/SavvyNik/SimpleList
@@SavvyNik well, now it's not a prob, the new prob is that visual studio code doesn't recognize conio.h and windows.h
@@ermacellaio1657 - Is there a reason you're trying to include these two header files? I assume you're trying to create your own code and not following the series because these two are not referenced.
very very helpfull
@Hapy Sethi - Thanks!! I'm glad you found it helpful. Make sure to destroy that like button for me if you haven't already ^^
@@SavvyNik i like all your videos before it start playing
@@hapysethi1306 - Well I appreciate that very much!! Thanks for following it means a lot =)
@@hapysethi1306 - Well I appreciate that very much!! Thanks for following it means a lot =)
I can't get "make" to work in VS Code installed on Windows 10. Can I get some help, please?
I assume you installed the make binaries somewhere on your computer. You will need to add the directory where the binaries are located to your environmental path and that should be it.
@@SavvyNik You are magical! It works beautifully. I was building a C++ project in which I have 3 separate files: the header file, the implementation file, and the client file, and I was not able to get it to work until I watched this video and downloaded make. Many thanks! I will be watching your videos more often.
@@silviapreston4949 Awesome to hear! Glad I could help.
hey am having the same problem. I have a linux windows 10. Can you help me please?
Hey I just had a quick question. For some reason bash doesn't recognize make as a command; I made sure that the extension was enabled but still nothing. Is there anything I can do to resolve this. Thank you and this video was really informative.
@David Martinez - No problem, that's interesting. I'm wonder if you're missing a package which comes standard with most linux distributions called "build-essential". Are you using some linux distro? And you're sure you navigated to the project where a "makefile" file is located before running make? Those are the few things I could think of =)
it says make command not found ( bash integrated terminal in vstudio ) . Can you please guide ?
You'll need to install make for windows / linux. If you're using Ubuntu in terminal try sudo apt install build-essential
I getting this error:
gcc -std=c11 -Wall -o test
gcc: fatal error: no input files
compilation terminated.
make: *** [Makefile:36: test] Error 1
As I'm beginner to coding and VS Code, I'm totally lost seeing this. Could you please help?
This -> gcc -std=c11 -Wall -o test
is wrong. There needs to be a file before the -o that will get compiled into a file called test.
For example: gcc -std=c11 -Wall main.cpp -o main
@@SavvyNik what wrong I did to cause this error?
Not sure what happened, but seems like it was missed.
Is there any tutorial available to do the same thing on windows ? (build all project files using make)
I don't personally have one. Mainly you would want to install make and build tools on windows put them in your env path and then you should have a similar process.
@@SavvyNik Thanks a lot for your reply ! tbh that is what I have been trying to do, could you kindly link me to where I could download 'make' from, I have tried GnuWin32 and updated Path to the \bin folder, After that, the Command Line recognizes 'make' as I use it. But, when it comes to building project, as you have shown in the video, it just gives me a bunch of errors, I know that comments are not meant for troubleshooting, etc. However I would really appreciate if you could point me towards the right direction in this case. Thanks a lot, very helpful video, you got a sub.
UPDATE: Never-Fn-Mind, it works perfectly on windows, I did literally nothing different on windows, I went back and read more about make files and made my own simple make files and played around with it and I realized it gives an error if I have more than one Make file even in a subdirectory where I have opened my project folder in VS Code, which was my issue, so went back and created a new fresh folder and did the exact steps you did on Linux on my Windows 10 Machine and it works perfect !
P.S I ended up installing Chocolaty from shell and used that package manager to install make, make.exe is now integrated to all my terminals but I am not sure where exactly the file is at but Chocolaty gives a log to find it after you install 'Make' if you want.
I am really excited to start creating folders and organise my header and implementation files on VS Code as its my Favourite, really thank you so much !
@@ahmedifhaam7266 Haha I was about to reply. I'm super glad you got things working! Congrats, no problem, and glad I could help. Hopefully you continue following the channel and make sure to smash that like button for me if you haven't already. Good luck coding :D
Hi, can u plz make a video on building C/C++ jobs through GitHub to Jenkins . Along with Static code analysis and code quality and Unit test as part of CI process.
how to add includes and lib?
Any quick ref to that?
@Aravind Doss - As long as you have some version of C++ installed and it's available to your environmental variables (windows) or ld_library_path (linux) then the system should have access to the proper libraries and be able to access them. gcc.gnu.org/install/binaries.html
Hey! I wrote "make2 in my terminal (Mac) and it doesn´t work... do you have any solution?
@Timoteo Feeney - Do you have a file called "makefile" in the folder your trying to execute the command "make" in?
Awesome video, how can I include multiple source and header directories in make file?
Luckily the way the script is made it automatically includes all source files in the source folder
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ make
+ ~~~~
+ CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Does anyone get this error help
Your windows machine doesn't have make installed on it. I assume you don't have the gcc tools either. You'll have to install make and add it to your environmental variables path. Here's a vid for gcc - ruclips.net/video/hCLIDph7-mU/видео.html
thanks for replying. I did install MingW before but i found out in the bin folder, there's no make.exe file so i have to create one by copy from mingw32-make and it worked out
@@yukirii awesome to hear. Congrats and glad you got it figured out and fixed. Make sure to smash that like button for me if you haven't already.
in the ".c" file if I set cursor on any variable, and type F12, cursor go to the define of this variable. In the Makefile this is not work. How to make Makefile F12 work similarly?
@Vitaly Lev
- Are you sure you don't have an extension that only applies that rule for c/cpp files because it's a c++ extension? Variables are defined differently in a makefile because they don't follow the same programming syntax as c++. It has it's own unique structure.
@@SavvyNikhi Savvy! thanks for quick answer! I understand that C and makefile have different syntax. and F12 works fine in C files. and it would be extremely useful if F12 worked similarly in a makefile. if you know how to do it, please help.
@@vitalylev - I'm not sure how to make it work. Maybe someone else has some insight on this. Can't say I've really tried. Also what are you editing inside the makefile? Usually it's just used to build a project and it should be able to handle multiple object compilation as long as it's all in the src folder.
@@SavvyNik I work with compiled projects that have hundreds of files. i have to work with several makefiles that are in different directories.
the first makefile causes the second, the second can cause the third, and so on. and already in the second it is absolutely not clear what the variables which are not described in this second file mean.
and besides, I didn't write those makefiles.
therefore, it would be very useful to be able to press f12 to quickly see the definition of a variable.
this is very important.
this could be done through the json file. but I can't.
example:
"[makefile]":
{
"key": "f12",
"command": "actions.find"
},
actions.find - for example.
not work.
@@vitalylev - You got a pretty big project! I could see how it could be helpful for you. I don't know of an extension for makefile that can help with some form of intellisense. Looks like there's a project ready for someone to tackle =)
hey idk if you will see this message but i keep getting an error where is says make is not recognized as a name it says check either the spelling or the path, but im sure i spelled make correctly, please help if you somehow see this
Hey there, I saw it =) are you using windows/linux?
@@SavvyNik I’m using windows
@@CrunchPasta You'll need to install make in order to use it on Windows and if you already have make sure that the environmental path is updated so your system knows where it is located. www.gnu.org/software/make/
@@SavvyNik ok thank you for the help
@@CrunchPasta You're welcome! Make sure to destroy that like button on the video for me if you haven't already =)
Hi, thanks for the video. I am wondering why after I use "make", it did nothing, literally nothing is printed
Hi Savy. Great explanation. It is really helpful.
I have one query . If we have multiple files and libraries linked with the project and we have CmakeLists.txt file with all the relationships defined.. Hope to create Makefile for that. Hoe to basically work with CmakeLists.txt file in VS CODE.
THANKS in advance.
Glad you enjoyed the video. I don't normally use make lists. Here's an article on what seems to be a guide for creating a project with cmakelists on Linux with VSCode: code.visualstudio.com/docs/cpp/cmake-linux
Thanks for the awesome video! Just one question. Under the SRCDIR path in the make file, do I have to type /home/name/projectfolder?
Or can I type ~/projecfolder to make it simpler?
No problem, glad you enjoyed it and make sure to smash that like button for me on the vid if you haven't already. I like to stick with absolute paths so the system has no chance of getting it wrong. I'm not sure if it knows the alias for ~ I would assume it does because it runs Linux, but you never know when a certain symbol is not allowed. Great question.
SavvyNik ok I’ll keep that in mind. I was just wondering in case I ever moved the project to a different computer. And thank you for the quick reply! Glad I found you videos and love your channel so far! Keep up the good work!
@@jscorpio1987 Of course, and thanks for the kind remarks! Glad to have you following the channel.
Got a problem
g++ -std=c++11 -Wall -o test
g++: fatal error: no input files
compilation terminated.
make: *** [Makefile:36: test] Error 1
help I've been trying so long to compile multiple files just to make one program from C++ tutorial :d
Hello, I'm doing a C++ project using this makefile extension but in my project I need to do a composition of classes, so I need to include a class1.h in my class2.h file, but when I 'make' in the terminal I get an error that the class2 didn't found class1. Maybe I need to change some makefile configurations but I don't know how to do it, can you help me?
As long as you have everything in the src folder the makefile scans all files and compiles anything that has been included. Make sure you've included your files properly among the various headers that you have and it should take care of itself. Otherwise keep watching the series because we do use classes with the exact thing you are suggesting.
make in windows doesn't work,could you have a solution of my problem?
@Mariam Albarghouti - You'll have to download make and install it for windows. Here's the official website: gnuwin32.sourceforge.net/packages/make.htm
They have an executable you can download the option called "Complete package, except sources" for the windows exe setup.
Thanks 💙
@@SavvyNik How do I intall it? I installed it but it still doesnt work?
@@RowanPlayZ - You ran through the installer and then restarted your computer? Just make sure you are in the proper directory before issuing make. A makefile must exist in the directory.
@@SavvyNik Hello, I installed "make", restarted, and i opened terminal in the same directory as the .cpp and makefile.
I get an error: The term 'make' is not recognized. Could you help me please? I have been trying to run C++ and compile it, following different tutorials... but everytime i get this same error " " is not recognized. running win10
Thanks
After installing vs code, I was able to use makefile created by Makefile project. Then it won't create makefile in another directory. Anyone knows what happened?
Thanks dude! How could you edit that Makefile if you want to use some libraries in your main.cpp ?
Hello Nik,
Nice explanation!
Query: If I created folder "TrialProj" under SIMPLELIST, when I do make all files get created in Parent folder is it any way to select particular folder to create Make files.
Thanks in advance :)
Sure there is you can specify the folder that you want to get built in the make file. Look for something called "src" in the config for the make.
@@SavvyNik yes that I understand, but is there any way when we give make command folder will get generat (src, obj, Make) into sud directory instead of parent directory?
@@nileshwalhekar6165 Ahh you want generate compilation in multiple directories/folders. Yes there's a way, but it's not simple to explain. You would have to modify the makefile to do this. Here are some examples: stackoverflow.com/questions/1139271/makefiles-with-source-files-in-different-directories
riptutorial.com/makefile/example/21376/building-from-different-source-folders-to-different-target-folders
@@SavvyNik Thanks 🙏
@@nileshwalhekar6165 you're welcome. Make sure to smash that like button for me on the vid.
@SavvyNik is there a way to stop my .exe application closing immediately? Thanks for considering my request.
@SERO - Sure use a while loop and check for a condition or just do:
while(1) {
//your statements
}
That'll make an infinite loop and keep executing whatever is inside or you can use a sleep if you use #include then sleep(3) - that would sleep for 3 seconds. What are you trying to accomplish w/o your program closing immediately? Do you want the user to select an option to quit? If you keep watching the series I actually show a function that does just that.
@@SavvyNik I am actaully just trying to read what the program prints out.
just tried your sleep code suggestion, .exe won't open now :(
@@dera0374 - Ahh well a cheap way to do that then is to use cin >> someVariable; That will force the program to have to wait for an input from the user before continuing and all you need to do is define someVariable like int someVariable; of course it won't matter what you're supplying to the terminal you could just press enter to continue, but I think that would give you the result you are looking for =)
@@dera0374 - Get rid of the sleep and try my latest suggestion =D
does the procedure here is applicable in windows too?
Yes
Download a 25 page Linux Checklist here - learn.savvynik.com
New to C++? Start learning the Basics here - @JxUE (with 30+ videos!!)
Episode #3: ruclips.net/video/PT6Nxwpeckw/видео.html
Here's the code if you need it (Repo) - github.com/SavvyNik/SimpleList
Not so helpful for people using windows. Guess I'll have to spend a $1000 on a mac so I can just freaking get my university projects done with ease AT LEAST...People keep saying how amazing Visual Studio is. IT SUCKS....It can't even do large projects and only runs one .cpp file....
Why couldn't you use a makefile on Windows? There's options to install Make on Windows as well. Worst case don't bother spending extra money purchasing a Mac when you could install a Linux operating system for free.
@@SavvyNik I was able to solve it by simply using g++ *.cpp to compile everything. I have a question though. Why is my terminal opening outside vscode? I want it like yours and many others who have it embedded within vscode..how do I do that? I can't find a single video over that..
@@TheGreatKhan well that's great. Didn't realize you could do that lol. Thanks for sharing. I'm not sure why your terminal is opening outside of vscode. That's not the default function. You should be able to go to view->terminal inside vscode and that should launch a terminal inside vscode. code.visualstudio.com/docs/editor/integrated-terminal
SavvyNik Don’t worry about that! Got it fixed. Had to turn the contpy off. But yes google should seriously include g++ *.cpp for everyone out there to see lol
@@TheGreatKhan lol yeah kind of blows my mind. I'll have to try this later. Makes things much easier.