C++ Tutorial for Beginners #2: Visual Studio Code - Makefile & Multi File Extension | (Linux)

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ต.ค. 2024

ความคิดเห็น • 167

  • @SavvyNik
    @SavvyNik  ปีที่แล้ว +1

    My NEW in depth C++ Course is now available at - learn.savvynik.com/

  • @yoofyoof9706
    @yoofyoof9706 2 ปีที่แล้ว +11

    beginner in C here struggling with assignments for creating a make file. I'm so glad I found your video! thanks so much!

    • @SavvyNik
      @SavvyNik  2 ปีที่แล้ว

      You're so welcome!

  • @galaxymariosuper
    @galaxymariosuper 3 ปีที่แล้ว +11

    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"

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว +1

      Thanks for the mention and if you need help installing MinGW on Windows make sure to check out th-cam.com/video/hCLIDph7-mU/w-d-xo.html

    • @TheBoxingBinge
      @TheBoxingBinge 2 ปีที่แล้ว +2

      thanks!, But then I get this error: g++: fatal error: no input files

    • @kamc8834
      @kamc8834 ปีที่แล้ว +1

      you literally saved my life, thanks!!

    • @inthein-between8307
      @inthein-between8307 ปีที่แล้ว +2

      THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

  • @adhamelbahrawy9891
    @adhamelbahrawy9891 4 ปีที่แล้ว +3

    You saved me after 2 weeks of trying to write a generic makefile from scratch and hours and hours of debugging

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      Awesome to hear!! Glad it worked out for you. Make sure to destroy that like button button for me ^^

  • @birdwithoneleg
    @birdwithoneleg 4 ปีที่แล้ว +3

    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.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @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 =)

  • @avishekpdsyouthoob9083
    @avishekpdsyouthoob9083 4 ปีที่แล้ว +2

    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

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @AvishekPD's YouThoob - Thanks ^^

  • @sofianeyaacoubi6456
    @sofianeyaacoubi6456 2 ปีที่แล้ว +2

    this dude makes stuff simple ...thanks budd

    • @SavvyNik
      @SavvyNik  2 ปีที่แล้ว

      You're welcome! Glad to help.

  • @joaquinortiz279
    @joaquinortiz279 4 ปีที่แล้ว +6

    You got a new subscriber, it's amazing how easy you explain everything!

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @Joaquin Ortiz
      - Awesome!! I'm glad your following and thanks for the kind remarks it means a lot!! =)

  • @shimuk8
    @shimuk8 3 ปีที่แล้ว +1

    Aaaaand the saviour of the day is SAVVYYYYNIKKKKK !!

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว +1

      Haha glad you found the video helpful =)

  • @guzgamer
    @guzgamer 3 ปีที่แล้ว +1

    Thanks so much! Now I can move forward with intro to programming class!

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      Awesome to hear! No problem. Make sure to destroy that like button for me if you haven't already =D

  • @obensustam3574
    @obensustam3574 ปีที่แล้ว +1

    Thank you for this helpful content

    • @SavvyNik
      @SavvyNik  ปีที่แล้ว

      No problem, glad you found it

  • @МаксимКузьмин-м6з
    @МаксимКузьмин-м6з 4 ปีที่แล้ว +5

    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.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      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.

  • @muonline2067
    @muonline2067 2 ปีที่แล้ว +1

    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.

  • @elyortuxtamuratov3140
    @elyortuxtamuratov3140 ปีที่แล้ว +1

    thank you :-) it's helpful

  • @ronaldlogan3525
    @ronaldlogan3525 3 ปีที่แล้ว +1

    Very good presentation !

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      Thanks. Gland you enjoyed it!

  • @madamadadane7989
    @madamadadane7989 3 ปีที่แล้ว +4

    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!

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว +2

      Glad you got things figured out and didn't give up! Awesome job.

  • @UyandaMaseti
    @UyandaMaseti 9 หลายเดือนก่อน +1

    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.

    • @SavvyNik
      @SavvyNik  9 หลายเดือนก่อน

      Glad you found the channel! New updated & recreated videos on this series coming soon :)

  • @pallasepithet
    @pallasepithet 4 ปีที่แล้ว +1

    Man you're more than awesome. Thanks.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      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 =)

  • @ahtamim1259
    @ahtamim1259 3 ปีที่แล้ว +1

    nice work. champ

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      Glad you enjoyed the video! Make sure to smash that like button for me if you haven't already =)

  • @Mandeepsingh-jo5cf
    @Mandeepsingh-jo5cf 4 ปีที่แล้ว +8

    @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..

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @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.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @jankk 04 - If you try cloning my repo and building it with make do you still have the same issue? github.com/SavvyNik/SimpleList

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +2

      @jankk 04 - 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.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +2

      @jankk 04 - Ahh okay, well thanks for letting me know and for the kind remarks!! Make sure to destroy that like button for me if you haven't already ^^

    • @ayushdutta2113
      @ayushdutta2113 4 ปีที่แล้ว +6

      @@SavvyNik hey I got the same error . But you can make it go away by making sure that the SRCDIR in MakeFile is set to src . Make sure that you have all your .cpp in the src folder. The common rule is to start by ctrl+shift+p -> make INIT Project -> C++ Project before writing any code. Then start with main.cpp in the src folder created for you.

  • @SofianMW
    @SofianMW 2 ปีที่แล้ว +1

    very useful, thanks much!

    • @SavvyNik
      @SavvyNik  2 ปีที่แล้ว

      You're welcome!

  • @gj2u
    @gj2u 3 ปีที่แล้ว +2

    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!

  • @hazemahmed8333
    @hazemahmed8333 3 ปีที่แล้ว +2

    Thank you for the amazing work!!.

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      You're welcome!! Glad you found it helpful and make sure to smash that like button for me if you haven't already =)

  • @silviapreston4949
    @silviapreston4949 3 ปีที่แล้ว +3

    I can't get "make" to work in VS Code installed on Windows 10. Can I get some help, please?

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว +1

      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.

    • @silviapreston4949
      @silviapreston4949 3 ปีที่แล้ว +1

      @@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.

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      @@silviapreston4949 Awesome to hear! Glad I could help.

    • @kershwinveeramootoo4598
      @kershwinveeramootoo4598 2 ปีที่แล้ว

      hey am having the same problem. I have a linux windows 10. Can you help me please?

  • @ahmedifhaam7266
    @ahmedifhaam7266 3 ปีที่แล้ว +3

    Is there any tutorial available to do the same thing on windows ? (build all project files using make)

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      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.

    • @ahmedifhaam7266
      @ahmedifhaam7266 3 ปีที่แล้ว +1

      @@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.

    • @ahmedifhaam7266
      @ahmedifhaam7266 3 ปีที่แล้ว +1

      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 !

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว +1

      ​@@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

  • @DavidMartinez-hi4gb
    @DavidMartinez-hi4gb 4 ปีที่แล้ว +3

    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.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @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 =)

  • @thefoxdubs
    @thefoxdubs ปีที่แล้ว +3

    The Makefile extension doesn't work anymore :((((

    • @SavvyNik
      @SavvyNik  ปีที่แล้ว

      Thanks for letting me know. I'll have to check and see what's up with that.

  • @ahmedguetat2079
    @ahmedguetat2079 4 ปีที่แล้ว +2

    thank you, it's a clear explainig

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @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 =)

  • @MKSundaram
    @MKSundaram 3 ปีที่แล้ว +1

    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?

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      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

    • @MKSundaram
      @MKSundaram 3 ปีที่แล้ว +1

      @@SavvyNik what wrong I did to cause this error?

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      Not sure what happened, but seems like it was missed.

  • @sreekarg7583
    @sreekarg7583 3 ปีที่แล้ว

    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.

  • @cherry7507
    @cherry7507 3 ปีที่แล้ว +1

    it says make command not found ( bash integrated terminal in vstudio ) . Can you please guide ?

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      You'll need to install make for windows / linux. If you're using Ubuntu in terminal try sudo apt install build-essential

  • @yima8746
    @yima8746 2 ปีที่แล้ว

    Hi, thanks for the video. I am wondering why after I use "make", it did nothing, literally nothing is printed

  • @sharathbs9438
    @sharathbs9438 2 ปีที่แล้ว +1

    Awesome video, how can I include multiple source and header directories in make file?

    • @SavvyNik
      @SavvyNik  ปีที่แล้ว

      Luckily the way the script is made it automatically includes all source files in the source folder

  • @vitalylev
    @vitalylev 4 ปีที่แล้ว +2

    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?

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @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.

    • @vitalylev
      @vitalylev 4 ปีที่แล้ว +1

      @@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.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @@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.

    • @vitalylev
      @vitalylev 4 ปีที่แล้ว +1

      @@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.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      ​@@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 =)

  • @No_handle-_-
    @No_handle-_- 4 ปีที่แล้ว +2

    THANK YOU MY GUY ThIS HELPED ME

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @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

  • @CrunchPasta
    @CrunchPasta 4 ปีที่แล้ว +2

    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

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      Hey there, I saw it =) are you using windows/linux?

    • @CrunchPasta
      @CrunchPasta 4 ปีที่แล้ว +1

      @@SavvyNik I’m using windows

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @@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/

    • @CrunchPasta
      @CrunchPasta 4 ปีที่แล้ว +1

      @@SavvyNik ok thank you for the help

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @@CrunchPasta You're welcome! Make sure to destroy that like button on the video for me if you haven't already =)

  • @andmotta9686
    @andmotta9686 3 ปีที่แล้ว +1

    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?

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว +1

      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.

  • @parasgupta91
    @parasgupta91 3 ปีที่แล้ว +1

    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.

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      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

  • @ewrl1773
    @ewrl1773 3 ปีที่แล้ว

    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

  • @enigmothread3207
    @enigmothread3207 3 ปีที่แล้ว

    Thanks dude! How could you edit that Makefile if you want to use some libraries in your main.cpp ?

  • @mofeeni
    @mofeeni 4 ปีที่แล้ว +2

    Hey! I wrote "make2 in my terminal (Mac) and it doesn´t work... do you have any solution?

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @Timoteo Feeney - Do you have a file called "makefile" in the folder your trying to execute the command "make" in?

  • @hassankamel8209
    @hassankamel8209 4 ปีที่แล้ว +3

    i love u so much thanks for this tut 3>

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @hASSAn kAMEl - Glad it was useful =) no problem!! I'm dropping another episode really soon ^^

  • @hapysethi1306
    @hapysethi1306 4 ปีที่แล้ว +2

    very very helpfull

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @Hapy Sethi - Thanks!! I'm glad you found it helpful. Make sure to destroy that like button for me if you haven't already ^^

    • @hapysethi1306
      @hapysethi1306 4 ปีที่แล้ว +1

      @@SavvyNik i like all your videos before it start playing

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @@hapysethi1306 - Well I appreciate that very much!! Thanks for following it means a lot =)

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @@hapysethi1306 - Well I appreciate that very much!! Thanks for following it means a lot =)

  • @nileshwalhekar6165
    @nileshwalhekar6165 4 ปีที่แล้ว +1

    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
      @SavvyNik  4 ปีที่แล้ว

      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.

    • @nileshwalhekar6165
      @nileshwalhekar6165 4 ปีที่แล้ว +1

      @@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?

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @@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

    • @nileshwalhekar6165
      @nileshwalhekar6165 4 ปีที่แล้ว +1

      @@SavvyNik Thanks 🙏

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @@nileshwalhekar6165 you're welcome. Make sure to smash that like button for me on the vid.

  • @mariamalbarghouti4385
    @mariamalbarghouti4385 4 ปีที่แล้ว +2

    make in windows doesn't work,could you have a solution of my problem?

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +3

      @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.

    • @mariamalbarghouti4385
      @mariamalbarghouti4385 4 ปีที่แล้ว +1

      Thanks 💙

    • @RowanPlayZ
      @RowanPlayZ 4 ปีที่แล้ว +2

      @@SavvyNik How do I intall it? I installed it but it still doesnt work?

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @@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.

    • @dera0374
      @dera0374 4 ปีที่แล้ว +1

      @@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

  • @yukirii
    @yukirii 3 ปีที่แล้ว +1

    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

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      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 - th-cam.com/video/hCLIDph7-mU/w-d-xo.html

    • @yukirii
      @yukirii 3 ปีที่แล้ว +1

      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

    • @SavvyNik
      @SavvyNik  3 ปีที่แล้ว

      @@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.

  • @jscorpio1987
    @jscorpio1987 4 ปีที่แล้ว +1

    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?

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      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.

    • @jscorpio1987
      @jscorpio1987 4 ปีที่แล้ว +1

      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!

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @@jscorpio1987 Of course, and thanks for the kind remarks! Glad to have you following the channel.

  • @dera0374
    @dera0374 4 ปีที่แล้ว +2

    @SavvyNik is there a way to stop my .exe application closing immediately? Thanks for considering my request.

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @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
      @dera0374 4 ปีที่แล้ว +1

      @@SavvyNik I am actaully just trying to read what the program prints out.

    • @dera0374
      @dera0374 4 ปีที่แล้ว +1

      just tried your sleep code suggestion, .exe won't open now :(

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      ​@@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 =)

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @@dera0374 - Get rid of the sleep and try my latest suggestion =D

  • @teemmarley5809
    @teemmarley5809 2 ปีที่แล้ว

    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?

  • @aravinddoss4127
    @aravinddoss4127 4 ปีที่แล้ว +2

    how to add includes and lib?
    Any quick ref to that?

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @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

  • @markwalterbilaro7007
    @markwalterbilaro7007 ปีที่แล้ว

    does the procedure here is applicable in windows too?

  • @SavvyNik
    @SavvyNik  4 ปีที่แล้ว +1

    Download a 25 page Linux Checklist here - learn.savvynik.com​
    New to C++? Start learning the Basics here - @JxUE (with 30+ videos!!)
    Episode #3: th-cam.com/video/PT6Nxwpeckw/w-d-xo.html
    Here's the code if you need it (Repo) - github.com/SavvyNik/SimpleList

  • @TheGreatKhan
    @TheGreatKhan 4 ปีที่แล้ว +1

    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....

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      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.

    • @TheGreatKhan
      @TheGreatKhan 4 ปีที่แล้ว +2

      @@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..

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว

      @@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

    • @TheGreatKhan
      @TheGreatKhan 4 ปีที่แล้ว +1

      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

    • @SavvyNik
      @SavvyNik  4 ปีที่แล้ว +1

      @@TheGreatKhan lol yeah kind of blows my mind. I'll have to try this later. Makes things much easier.