ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

C++ Tutorial for Beginners #1: Visual Studio Code Programming Setup & Use | (Linux)

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ส.ค. 2024
  • C++ Tutorial for Beginners Episode 1 where we Setup and Use Visual Studio Code on Linux. This C++ Tutorial is intended for C/C++ Beginners with Programming in 2021 and will help you setup Visual Studio Code on Linux and you'll get help Programming your first Hello World program. You'll be shown two different methods of installing Visual Studio Code on your computer. Also make sure to subscribe so you can follow the series and develop.
    This first install method shown will be using a graphical software package manager and the second method is installing the package through a terminal using a shell command. Choose whatever method is easier for you, both are fairly quick. Look below for information that was mentioned in the video. We'll be posting more videos and start our program soon so stay tuned and make sure to subscribe.
    My Linux Cheat Sheet and 25 Page Checklist here:
    📚 learn.savvynik...
    Share this free tool and support Small TH-camrs
    editbulk.com
    (I made this tool to help creators)
    Want more info/content?
    savvynik.com
    GitHub Repo of Project - github.com/Sav...
    Download Visual Studio Code:
    code.visualstu...
    Name of extensions installed:
    1. Code Runner
    2. C/C++
    Installing Visual Studio Code through Terminal:
    sudo dpkg -i Downloads/code_1.40.2-1574694120_amd64.deb; sudo apt install -f
    NOTE! Make sure to place the proper version number that was downloaded instead of code_1.40.2-1574694120_amd64 it might be code_x.x.deb
    Linux Install Videos:
    Ubuntu 19 - • Ubuntu 19.10 Eoan Ermi...
    Ubuntu 18 - • Ubuntu 18.04.3 Bionic ...
    Kali Linux - • Kali Linux Install Tut...
    PCLinuxOS: • PCLinuxOS Install KDE ...
    openSUSE: • openSUSE Tumbleweed In...
    Zorin 15: • Zorin OS 15 Core Insta...
    Fedora 31: • Fedora 31 Workstation ...
    MX Linux 19: • MX Linux 19 Install | ...
    ArcoLinux : • ArcoLinux OS Install |...
    Solus Linux OS : • Solus Linux OS 4 Insta...
    Endeavour OS : • Endeavour OS Review, P...
    CentOS 8 NetInstall : • CentOS 8 NetInstall Li...
    Parrot Security OS: • Parrot Security OS | L...
    CentOS 8: • CentOS 8 Install Linux...
    Fedora 30: • Fedora 30 Workstation ...
    Elementary OS 5: • Elementary OS Juno 5.0...
    Arch Linux : • Arch Linux Install 201...
    MX Linux 18: • MX Linux 18.3 Install ...
    Linux Lite 4: • Linux Lite 4.6 Install...
    Debian on Vbox: • Debian 10 Buster Insta...
    Manjaro 18: • Manjaro Install Tutori...
    Debian 10: • Debian 10 Buster Insta...
    Ubuntu Server 19: • Ubuntu 19.04 Server In...
    Linux Mint 19: • Linux Mint 19 Install ...
    Linux Talk :
    Talk #1 ZFS vs EXT4 Storage Benchmark - • Linux Talk : Ubuntu 19...
    Talk #2 ZFS vs EXT4 Memory Usage - • Linux Talk #2: Ubuntu ...
    Talk #3 Supervisor Process Control - • Linux Talk #3: Supervi...
    Talk #4 LVM vs Standard Partition - • Logical Volume Managem...
    Talk #5 Linux Static IP Address - • Linux Talk #5: Static ...
    Software Use:
    VirtualBox - • How To Use VirtualBox ...
    TeamViewer - • Teamviewer Remote Acce...
    00:00 Intro
    00:48 Beginning of Graphical Install
    02:51 Review of Visual Studio Code
    06:12 Adding necessary extensions for C++
    08:49 Creating our first program
    13:31 Installing VSC through Terminal

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

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

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

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

    Thank you! I’m learning C++ and I just installed Linux on my computer. I couldn’t figure out how to set up visual studio code for running simple C++ programs and all the other set up tutorials are too complicated for a newbie like me to follow. You kept it simple and easy and now I can go back to studying without fighting my computer! lol. Thanks! Liked and subscribed.

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

      Awesome JT!! Thanks for sharing and I'm super glad it worked out for you so you can continue your programming experience. Thanks for subbing!!

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

    Some Time Shortcuts:
    Beginning of Graphical Install : 00:48
    Review of Visual Studio Code : 2:51
    Adding necessary extensions for C++ : 6:12
    Creating our first program : 8:49
    Installing Visual Studio Code through Terminal : 13:31

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

      thanks

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

      @@danielgjypi - No problem! Make sure to destroy that like button on the video if you haven't already =)

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

      @@SavvyNik help me, the microsoft extension does not appear, I use arch

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

    Download a 25 page Linux Checklist here - learn.savvynik.com
    New to C++?? Start Here: th-cam.com/play/PLKMOdY6Bhga5ws13FNCbD0103pXEP-VFV.html
    Episode #2: th-cam.com/video/whQQF4kVjPY/w-d-xo.html
    Here's the code if you need it (Repo) - github.com/SavvyNik/SimpleList

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

    I wasted some 3 hours trying to figure out how to run c++ code on VSCode, and then I stumbled upon this video. Thanks for posting such a useful video man! You really saved the day!! There are plenty of videos available out there for windows, but none for ubuntu.

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

      @Kshitij Kumar - Awesome!! Glad it helped you =)

  • @kingbsk-1forreal267
    @kingbsk-1forreal267 หลายเดือนก่อน

    Downloading it for my everyday practice... Thanks so much for sharing this great knowledge of yours to a beginner like me.

  • @woody-xm5ve
    @woody-xm5ve 4 ปีที่แล้ว +5

    Thank you very much for the tutorial videos! I sure did subscribed in and will like the videos. Thanks again!

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

      @woody - No problem!! I'm glad you enjoyed the tutorials. Thanks so much for subscribing, being part of the channel, and liking that means a lot to me!! =)

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

    I worked with Visual Studio before but never with Visual Code and it's different but your tutorial help me a lot, thank you!

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

      Awesome! Glad you found it helpful. If you haven't already make sure to smash that like button for me on the video =)

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

      @@SavvyNik I already did and also I subscribed

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

      @@nauj8316 Awesome!! Glad to have you following ^^

  • @shrippie-4214
    @shrippie-4214 3 ปีที่แล้ว +2

    thank you i was a little confused on how to get c++ to work :) world here i come

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

      You're welcome! I'm glad you found the video helpful.

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

    Thaaaanks man, you were a big help ^^ I was pretty f*ed up at this point of trying things to be finally able to pragramm and thanks to you I can finally start :)

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

      Awesome to hear =) I'm glad you got things sorted with the video. Good luck in your programming adventures!

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

    Thank you for your helpful tutorial. Great intro to C++ and Visual Studio Code!

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

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

  • @JimmyBComputerGuy
    @JimmyBComputerGuy 2 หลายเดือนก่อน

    Various other different - wow. Hang on, I'm gonna go ahead. But seriously, nice video. Very helpful. Thanks.

  • @svi16ka40
    @svi16ka40 4 ปีที่แล้ว +7

    You are amazing bro.Thank you!

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

      @Svilen Vlogs - Thanks so much!! That means a lot =) Make sure to leave a like for me if you haven't already ^^

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

    Wow thank you a lot. Please keep doin this series!

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

      You're welcome! Make sure to smash that like button for me if you haven't already and the series is done at this point. There's 24 videos =)

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

    Thank you for this video. I was looking for a way to create a new project like on Windows but apparently that doesn't exist on Linux and you just go ahead and start coding in a new file instead. This took me days to figure out as a beginner.

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

      You're welcome! Glad you found the video helpful =)

  • @BillHohensee
    @BillHohensee 4 ปีที่แล้ว +7

    Hi Savvy - great stuff, thanks for expertly sharing! Unfortunately, when running my main.ccp with Hello World I too exited with code = 1. I think the problem is I followed through your instructions with VS Code on Linux. I am running Windows 10. I think I need help configuring the C/C++ extension on Win10? Here's the full error message I received:
    [Running] cd "g:\Visual Studio 2019\SimpleList\" && g++ main.cpp -o main && "g:\Visual Studio 2019\SimpleList\"main
    'g++' is not recognized as an internal or external command,
    operable program or batch file.
    [Done] exited with code=1 in 0.06 seconds
    Your thoughts??

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

      Ah, to answer my own question, I followed the instructions below, successfully installed MinGW, and successfully ran main.cpp in Visual Studio Code to get Hello World! exited with code=0.
      code.visualstudio.com/docs/cpp/config-mingw

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

      Hey Bill! Thanks for your kind remarks. Your issue is that the system isn't recognizing g++ as a system command. This is because you have a Windows based system, that doesn't come with the gnu compiler tools for C/C++ pre-installed. You'll have to manually install the tools and that can be quite a task. Here's a very nice reference from visual studio code about how to go about getting things setup: code.visualstudio.com/docs/cpp/config-mingw
      I was hoping to do a video about how to adapt this project to a Windows platform in the future, but I'm trying to finish it out on Linux first before making that adaptation.

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

    I wrote the code just as you did but on compiling It says, "g++ is not recognized as an internal or external command, operable program or batch file". Also, "#include " etc doesn't get highlighted while typing.

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

      Bilal Ahmed Khan Niazi - That just means you don't have a c++ compiler installed. Look for the GNU Compiler Tools. I assume your are using Windows? If you're using linux install the build-essentials package and that should get you started. (ref: gcc.gnu.org/install/binaries.html)

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

    Thank you so much man! best tutorial i saw

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

      Awesome to hear!! Glad you enjoyed it. Make sure to smash that like button for me if you haven't already =)

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

    Very nice video thanks a lot, but I can't pass trough the the program don't recognice the command, what should i do?

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

      Did you get past this issue? The VSCode might not be recognizing iostream, but that doesn't mean that it's not there. Try compiling still and see what errors you get. If you do get an error post it here.

  • @crankylucifer
    @crankylucifer 11 หลายเดือนก่อน +1

    Why not include stdin.h and/or stsout (don't remember which one) instead of using std::?
    I wrote a very simple hello world yesterday (just started and want to learn the basics of c++ programming) and it worked just fine without the std:: addition in the text

    • @SavvyNik
      @SavvyNik  11 หลายเดือนก่อน +1

      Yeah depends if you want to use namespaces but people shouldn’t solely depend on namespaces bc when you start adding multiple libraries it can be hard to distinguish where functions / objects are coming from unless you use the Object:: method

    • @crankylucifer
      @crankylucifer 11 หลายเดือนก่อน +1

      @@SavvyNik that makes a lot of sense, thank you! :)

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

    bit late to comment but if you are using any Arch Based distro there is no Visual Code in pacman but it's instead renamed as Code - OSS in community repo

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

      @AvishekPD's YouThoob - Awesome tip! Thanks.

  • @PJ-en6ru
    @PJ-en6ru 4 ปีที่แล้ว +4

    can you help me? this shows every time i run the program.
    // c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
    collect2.exe: error: ld returned 1 exit status //

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

      Check line 16. There seems to be a function call to WinMain that doesn't exist in your program. More than likely there's no prototype for it (definition at beginning of program before main) or you didn't include a proper library with the function. Are you making a call to something named WinMain and if you are is it a function you created or trying to include?

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

    Why am I getting such an error and How can I solved the problem Savy?
    dpkg: error: archive '/' is not a regular file

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

      What are you trying to do? Setup VSCode on Linux?

  • @Dan-hx9sd
    @Dan-hx9sd 3 ปีที่แล้ว

    So I followed this and I keep getting the error "/bin/sh: 1: g++: not found".
    Vscode also doesn't like "#include ". Anybody else have this error?
    Edit: never mind just needed to download "sudo apt install build-essential gdb g++"

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

    I use archlinux and the C++ related extensions don't show up on my martketplace.
    Any help would be appreciated.

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

    Can I follow along with this series even though I'm on Windows? Are there differences between the Linux and Windows versions??

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

      @The Derpsters - Good question! Visual Studio Code will be pretty much the same, but the way all the necessary tools like make and g++ are installed might be different. Eventually, after the series is over I was hoping to make the video to show how to port over to Windows, as well as, Mac. Mainly the differences would be the terminal use and installing Make through an executable and gnu c++ compiler tools.

    • @user-fh7ki5bv5x
      @user-fh7ki5bv5x 4 ปีที่แล้ว +2

      If you are still looking for an answer, check out Visual Studio, it's a full IDE with all the compilation tools built in, although Visual Studio is only Windows and Mac which is most likely why this series doesn't use it

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

      ​@@user-fh7ki5bv5x - Very much correct, a big reason is cross platform use. Also the VS Code's ability to work with many many different programming languages that VS doesn't offer is another big reason you might want to use VS code for versatility. All you have to do is install extensions and you can tailor your IDE to a new language easily.

    • @woody-xm5ve
      @woody-xm5ve 4 ปีที่แล้ว +2

      I believe you can use the Windows Subsystem for Linux.

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

      @@woody-xm5ve - Yeah potentionally WSL2 if you want to follow along on Linux or a virtual machine from VirtualBox with Linux installed. Good mention. Overall, the guide shouldn't be much different on Win10 than Linux. Just have to initially install some compiler tools (MinGW package).

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

    help me, the microsoft extension does not appear, I use arch

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

    I have seen some tutorial that doesn't include "std::" before "cout" or "endl" is it just a visual basic thing or necessary everywhere?Also can you make a series for Python too : )

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

      @Avishek - Awesome question! It's syntax - if you want to access a function out of the standard library you have to tell the compiler what library you're pulling the function from "std::" is used in front of functions that are from the "standard" library. However, you're right that you can get away with without actually putting "std::" in front of every function from the library, but you have to use a namespace which I'll explain most likely in the next video :) I'm sure that they had a namespace defined in the tutorial that you are referencing. "using namespace std"

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

      @Avishek - I do have Python in the plans ^^ but first some C++

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

      because is used the std namespace before main method, code example: using namespace std;

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

    Hi! First of all, thank you for the video and explaining it in such a simple way. I have a question though, when you write a code that is meant to solve a math problem (for example) and once you run it and have to put the numbers or stuff like that, do you have to do it on the output that shows in vscode? Or it jumps other screen?
    I hope my explanation and grammar was acceptable, sorry in advance if I couldn't explain myself well enough lol.

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

      Hi Zsyfo! No problem, and thanks for the kind remarks. The console/terminal is where your program will be output. All information that needs to be passed on externally from a user must be done from this. Unless you create some sort of a GUI. I'm not sure if I'm following all the way though. Maybe an example of a function and what you are trying to accomplish would help. You can always join our discord if you want to share pics of what you mean. (Check out the about me page)

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

      @@SavvyNik Thank you for your fast answer! You've actually answered my question perfectly, so once again thank you, have a good day.

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

      @@zsyfo8400 Awesome! Make sure to destroy that like button on the video for me if you haven't already =)

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

    Hi, thanks for your tutorial. If I need to import a dll to Linux (Visual Studio Code) C++, how can I do it?

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

      @Chain Hong Lim - Generally, you would put the dll file somewhere where the system/project could see so let's say in the main project folder. After that you would link the dll file into the linker commands and then use functions from the dll file in your own code. Look at this for a example: www.oreilly.com/library/view/c-cookbook/0596007612/ch01s05.html
      I do not know of graphical way to include a dll file using vcode. That's more of a visual studio c++ method.

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

      @@SavvyNik Thank you for your advice , it helps a lot :)

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

      @@chainhonglim1281 - Awesome, glad I could help. Make sure to destroy that like button on the video for me if you haven't already and think about subbing ;)

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

    I am on a kubuntu, and I get this error on the first line:
    #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/myuser/Documents/SIMPLELIST/main.cpp).

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

      @Hassan Hatake - Can you still compile the program? That just seems like an IDE error. Check out this post for some suggestions: github.com/microsoft/vscode-cpptools/issues/1863

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

      Make sure gcc is installed, had the same error.
      sudo apt-get install build-essential

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

      @@eXpiwa - Thanks!

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

      @@eXpiwa I installed that and it still wont work? Any suggestions would really help

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

      sudo apt install g++

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

    I am trying to install visual studio code on bunsenlabs which is based on debian 10. I've found that I cannot build an C++ code. When i click Terminal > Configure Default Build Paths .. I dont see any c++ compiler at all. All I see is 'Build User Settings'. Do you have any suggestions?

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

      sudo apt install build-essential

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

      @@SavvyNik Thank You, very much sir.

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

      @@davidbarnwell6180 You're welcome. Glad you found it helpful. Make sure to smash that like button for me if you haven't already.

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

    I can seem to run my code .
    operable program or batch file.
    ''[Done] exited with code=1 in 0.054 seconds
    [Running] cd "c:\Users\thabang\Documents\Visual Studio 2019\" && g++ main.cpp -o main && "c:\Users\thabang\Documents\Visual Studio 2019\"main
    'g++' is not recognized as an internal or external command,
    operable program or batch file.
    [Done] exited with code=1 in 0.138 seconds'
    please help

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

      You need to install the GCC compiler tools on your system. Do you have Linux or Windows?

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

    Thank you so much, it's helpful

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

      No problem glad you found it helpful =) make sure to smash that like button for me on the video if you haven't already!

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

    So I don't have to set up build and debug files, just install the extensions instead?

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

      With code runner? Coder runner is setup to compile and run a single file program. Ex. just main.cpp I'm sure it can be setup to do more, but in the next video I show to create a make file build project with multiple source files if that's what you are looking for - th-cam.com/video/whQQF4kVjPY/w-d-xo.html

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

      @@SavvyNik thank you for the reply, I'll look into that in my next project. Now I just have a directory with simple C++ scripts and I want to compile each of them into the bin/ directory that is ignored by git, do you know how I can do that? Preferably with VSCode's own JSON files rather than extensions, if that's possible

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

      @@nikkehtine haven't done it directly through the JSON files. I normally create my own makefile to build my project with multiple object files.

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

    I believe I am getting a linking error. Below is the error I am getting at the moment...
    [Running] cd "/home/wirvin/Documents/SimpleList/" && g++ main.cpp -o main && "/home/wirvin/Documents/SimpleList/"main
    /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/10/../../../../lib64/crt1.o: in function `_start':
    (.text+0x24): undefined reference to `main'
    collect2: error: ld returned 1 exit status
    What did I overlook that is probably right in front of my proverbial nose?!!

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

      I'm running this in Fedora 32

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

      HAHAHAHAHA....It was a stupid mistake and right in front of my nose! BIGUNSSS saves the day, saved the file and then ran it....
      [Running] cd "/home/wirvin/Documents/SimpleList/" && g++ main.cpp -o main && "/home/wirvin/Documents/SimpleList/"main
      Not another Hello World statement?!!
      [Done] exited with code=0 in 0.55 seconds

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

      The compiler is telling you that something is wrong with the main function. Can you paste it in here. You must have at least one main() function for your program to work. It is where everything begins. Could be as simple as misspelling the name of main. Take a look and see if you find something obvious =) or paste the code here if possible.
      Example:
      int main() {
      printf("Hello world!");
      return 0;
      }

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

      @Trime2x1 - Awesome!! Glad you figured it out, disregard my last message. Didn't see that you resolved the issue =)

  • @abhisheksdhakad2630
    @abhisheksdhakad2630 4 ปีที่แล้ว +8

    when i write #include it says "#include errors detected. Please update your includepath"

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

      @sage_OMEGA - Are you using Linux, MacOS, or Windows? Sometimes if VSC cannot find the proper C++ libraries that are installed on your computer (usually bc the environmental variables aren't setup properly) you'll get an error like you did. What it's asking is to change up the config file in VSC to point to where your libraries are located. Look up includepath for visual studio code to see how to set it.

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

      @@SavvyNik okay thanks. I'm using Linux btw

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

      @@abhisheksdhakad2630 No problem, alright just making sure it wasn't another platform bc that could bring different issues =D if you run into more issues there is a discord for the channel: discord.gg/xP5FtAA feel free to join.

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

      @@SavvyNik sorted it out. Actually i forgot to install the compiler 😂😂😅

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

      @@abhisheksdhakad2630 - Haha sometimes it's the obvious things that are easy to skim over =D I'm glad you got it fixed. Be on the look out for a new episode tonight ^^

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

    for some odd reason it is saying that both cout and endl are not recognized as an internal or external command. I already installed both the c++ extension and runnner, am I doing something wrong?

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

      @taka shindow
      - Are these errors showing up while you are in Visual Studio Code or when you go and try to compile? Can you give the exact error. Typical issues are build-essentials aren't installed so no way to compile c++ files or this sounds like you could be missing a namespace definition. If you don't have using namespace std; defined you'll have to put std:: in front of anything belonging to the standard library in order to make a call to the function.

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

      @@SavvyNik It is in visual studio code, I'd imagine you are correct that I don't have something installed. I have no idea how else to explain it, but cout and endl aren't highlighted as it is in your explanation. I also used std:: before using cout as well

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

      @@takashindow5388 - Well interesting. Have you tried compiling yet? I'd compile and see if you get any errors maybe they will be more specific. I assume you're using Linux? Or are you using Windows?

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

      @@SavvyNik Windows, but I'll have to try again tomorrow. Thank you for responding though!

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

      @@takashindow5388 - Of course, no problem! If you need help tomorrow feel free to stop by the channel discord: discord.gg/P9QC2km if you want a quicker response.

  • @Jonathan-sz6rg
    @Jonathan-sz6rg 3 ปีที่แล้ว +1

    Could you make a guide on Vim and moving from VScode c++ development to Vim

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

      I don't usually suggest VIM for larger projects. It's great for editing files individually or quickly, but there's a lot built into an IDE to make you more productive, catch syntax issues, and linking variables/functions for easy access to them. Maybe a video where you'd benefit using VIM over an IDE?

    • @Jonathan-sz6rg
      @Jonathan-sz6rg 3 ปีที่แล้ว +1

      @@SavvyNik well sometimes people who start out with an IDE dont know what the IDE is doing. Some think that they can only build and make programs using buttons on their IDE and for example, dont know what build command is being run to build their projects.

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

      Yeah that's a good point. It would be nice to see edit a file, compile, and create a makefile directly from the terminal.. including debugging =D

  • @cbbcbb6803
    @cbbcbb6803 5 วันที่ผ่านมา

    Do you have a newer version?

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

    The extent of my next 3 months, learning C++

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

      Glad you found the channel =)

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

    Hi, Thanks for this playlist. Helped alot! I was wondering if the code runner extension could run a makefile too. Is that possible?

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

      I'm not sure about using code runner for that, haven't tried it before. I typically just interact using the terminal given in VSC.

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

    i wrote c in vs but it is showing ;
    include file not found in browse path

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

      Is this when you compile and are you using windows/linux?

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

      @@SavvyNik yes

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

    i think i have a tiny problem , when i go to install an extension it always shows errors
    and says that i have to download it manually , i do not know why it does not download in the vscode ??

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

      @it'smayar - Do you have the errors? I'm uncertain because I've never had any errors trying to install extensions. I would imagine some kind of config file or something being corrupt in VSCode. I wonder if you reinstalled it what would happen or perhaps try multiple extensions just to check if the one you're currently trying to install isn't just broken.

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

      @@SavvyNik OK ill see other extensions and reinstall it

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

      @@SavvyNik it always says Unable to open 'Extension: C++ Intellisense': An unknown error occurred. Please consult the log for more details..

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

      @@itssmayarr - Did you ever get to try out some different extensions?

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

      @@SavvyNik yes, i tried different extensions but it still shows me the same error

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

    Thanks mate, a really helpful video! Btw im a noob and for example if i wanna use c++ i always have to use : ".cpp" ? And what about python , java , html, etc ?please help me i wanna learn all of these good stuff

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

      Awesome! Glad it helped you =) make sure to destroy that like button for me if you haven't already! And yeah each language has it's own extensions. Like python has .py, html has .htm/.html, javascript has .js etc.. That's great that you want to learn. I suggest sticking to one language at first and if you can master one especially an object oriented one then I think the others come a lot easier, otherwise, you could spread yourself too thin and get overwhelmed ^^

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

      @@SavvyNik yup i gave you like :D and thanks btw there was a problem , when i use #include ... It fails and showme:"update includepath" any help please?

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

      @@SavvyNik ok thanks again i just solved it, suscribed and thanks again mate 😎❤

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

      @@elchistosoII - Awesome!! Glad you got it figured out and thanks for the update. Have fun coding =)

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

    Hi. I'm new in Linux and VS Code, I achieve the terminal compilation, but I'm wondering how to get the equivalent to the "exe" or "dll" files in VS2019 WIndows, I don't know how to get them in VS Code Windows either, when I try to compile with F5(what I suppose will give me the output file), I get a launch.json error, I already set the "program" section in .json with the recommended "name"(Linux has already set), but the error is still there.
    If you can help I thank you in advice.

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

      When you compile with g++ it's always generating some type of an executable/binary file. Both in Linux and Windows (if you've had a successful compilation). Now you won't be able to simply move the linux binary over to windows or visa versa, but you can recompile the code on either and then be able to run on whatever platform you are using as long as you have all the proper libraries.

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

      @@SavvyNik Thanks, now I know Linux compiled files have no extension, and I've already aware of SO and arch incompatibilities, that's why I tried to use VS Code since my project was finished in VS2019. I gave up trying to make it work, Code-Blocks is slightly better in terms of Path and Linker but still can't recognize the path, the easiest way was check incompatible/alternative libraries, use Geany to edit and use the Terminal compiler with include and lib flags.
      Still mad with VS Code, I follow every guide to setup path, checked a houndred times if the directory was ok with the subdir /** enabled, put it on task args, use make extension, etc. intelisense recognized every function but still says "such directory or file does not exist", well, at least I know VSC is useless with C++/opencv

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

      ​@@inkz34 I see.. so you only have issues when trying to include opencv? It can be a pain sometimes to get IDEs working properly. I prefer the terminal and a makefile usually over everything that way I don't overcomplicate things. Once I finally get stuff running/compiling in there then I migrate over to some type of IDE.

  • @RR-uv2sp
    @RR-uv2sp 3 ปีที่แล้ว

    When i run the program, it says "'gcc' is not recognized as an internal or external command,
    operable program or batch file. May you help me?

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

      I don't think you have the build tools to run. You need to install them as shown in the video. -> sudo apt install build-essential

    • @RR-uv2sp
      @RR-uv2sp 3 ปีที่แล้ว

      @@SavvyNik I couldnt install c/c++ debugger

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

    Sir when I run this program it shows
    G++ is not recognized as an internal or external command,operable program or batch file.
    Please help me

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

      Are you using Linux or Windows?

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

      @@SavvyNik sir I am using Windows 10

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

      @@SavvyNik Sir
      while using Windows any modification is needed?
      Pls rply

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

      @@makeawish7056 - You'll need GNU compiler tools. G++ is a compiler tool offered from the GNU Compiler Toolchain/Collection. This collection offers tools that allow you to compile programs for c/c++. These tools were created by the gnu project for use by everyone.

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

      @@SavvyNik sir how can I get or download GNU compiler tools?

  • @dev.antunes
    @dev.antunes 3 ปีที่แล้ว +1

    Thanks, SavvyNik. What about the graphics libary in C++ on Linux? Is it installed by default?

    • @dev.antunes
      @dev.antunes 3 ปีที่แล้ว

      I always have trouble with some old libraries :v . Could you please help me? ^^

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

      No Graphics libraries are not included by default. You'll need to find one and include it in your project in order to build successfully. There are plenty available however.

    • @dev.antunes
      @dev.antunes 3 ปีที่แล้ว +1

      @@SavvyNik Thank you so much!

    • @dev.antunes
      @dev.antunes 3 ปีที่แล้ว +1

      @@SavvyNik This really sucks xD

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

      @@dev.antunes haha definitely not the easiest language to use graphical libraries in!

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

    doesn’t work for me I don’t have simplelist so I can’t name stuff

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

    main.ccp: file not recognized: file format not recognized
    collect2: error: ld returned 1 exit status
    why do i get this error when i try to run the program? please help :(
    I've installed the necessary extensions

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

      The extension should be .cpp not .ccp it's not being recognized by the compiler.

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

      @@SavvyNik Oh god, thanks for the reply bro, it's working now. Also, your tutorials are very helpful for a beginner like me, Keep going. 🙌

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

      @@teabag5118 awesome!! Great to hear, glad I could help. I'll keep the vids coming ^^

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

    Bless you...

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

      Glad you found it helpful =) make sure to destroy that like button for me if you haven't already!

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

    Love you bro

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

    Which linux destro u think is best for beginners programmers

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

      Nouman Ahmad Sarwar
      - Great question! In my opinion it's Ubuntu. It supports most IDEs (including eclipse), easy to install, easy to use, and is stable. You really can't beat if especially if you're a beginner and just need a platform to have working tools on to program.

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

    if we create a makefile, can we delete run extension?

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

      Yes. Run extension isn't really needed, it's just there to help with simple compilation and running.

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

      @@SavvyNik so if we have a multiple file project, in order to build and run (debug) it we need to use makefiles?

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

      @@Liayn It definitely helps makes things much easier. You can get away with compiling multiple objects as well directly from a command line interface. Makefiles allow this process to be easier.

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

      @@SavvyNik thank you for answering!

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

      @@Liayn No problem, glad I could help. Make sure to smash that like button for me if you haven't already on the vid =)

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

    i tried to run it but it said it couldnt open the source file iostream i do not know what to do

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

      If you remove the iostream line and don't use anything in your main function does it compile (remove the cout

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

      @@SavvyNik ok so it says g++ not found but then it does compile successfully

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

      @@jasonphilips3023 if g++ is not found then it sounds like you need to install the compiler tools. If you are using windows watch this: th-cam.com/video/hCLIDph7-mU/w-d-xo.html

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

      @@SavvyNik i am using Linux but I still do not know if I have downloaded the right tools

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

      @@jasonphilips3023 which linux distro?

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

    Can you include your tasks.json and launch.json configuration files?

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

      @CodeX - Yeah if that will help you, I could add them to the repo. It'll be tonight before I get around to it. I'll let you know =)

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

      Thanks :D

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

      @@codex9117 - No problem! Make sure to destroy that like button for me ^^

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

      I did, although I can't find your config files.

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

      @@codex9117 - Sorry about that, the launch.json file is now available: github.com/SavvyNik/SimpleList I didn't have a tasks.json file so I didn't commit a file for that. Hope it helps ^^

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

    Yea vocode is the best IDE

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

      Glad you're enjoying the IDE

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

      @@SavvyNik Yea

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

    So you don't need to download a gcc/g++ compiler and add to your environment variable's path
    Is that correct..

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

      Are you using Windows? If your using Linux the build-essential package takes care of this for you.

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

      Here's a couple vids for install the compiler tools:
      Linux - th-cam.com/video/4e7pa6Pf3VQ/w-d-xo.html
      Windows - th-cam.com/video/hCLIDph7-mU/w-d-xo.html

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

      @@SavvyNik Is the Linux link supposed to lead to a different video? Both links lead to a Windows video

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

      @@kentarobarhydt787 Thanks for the post I accidentally copied the same link twice. One was supposed to be Linux! haha fixed it and here's the correct linux link - th-cam.com/video/4e7pa6Pf3VQ/w-d-xo.html

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

    my IDE doesn't show the play button

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

      @Kenny T Mule Jnr - You have to install an extension called code runner. The second episode in the series I believe will show this, but you don't necessarily need coder runner. Instead we install an extension called make.

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

      Here's a link to the vid mentioned above: th-cam.com/video/whQQF4kVjPY/w-d-xo.html

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

    hello I need your help I am working on windows, I have already done the installation of the c ++ extensions and the Code Runner extensions but I still get that g ++ is not recognized as an internal or external command, program or executable batch file, in which I may be failing

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

      Oscar, look up Mingw-w64. That software package can help you install the necessary tools to compile your program. These tools do not come standard with Windows and must be downloaded and installed. Then you'll more than likely have to add the install path to your environmental variables. I actually plan on coming out with a video on the setup process for Windows soon.

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

    Thanks

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

      I have been looking for a channel where C++ development with VS Code and Linux is systematically addressed and here it is. Please if possible, there are two more things that I'd be delighted if you could possibly help with: One is how can we setup a remote connection from Windows 11 to Linux Ubuntu step by step so that we can build a CMake Project in Visual Studio (not Code) on Windows using CMake and test it on Linux using remote setup directly. I believe it is possible. Furthermore, how can we develop and debug in Linux VS Code using CUDA step by step from scratch. Thank you so much!

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

      Glad you found the channel :) thanks for the feedback and suggestions. I'll write it down and I do plan on recreating a course for this series so I can plan on seeing what I can add for remote programming.

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

      @@SavvyNik Thank you Nik! I look forward. This is overview video from Microsoft on remote development in Visual Studio for Linux but it is just that: an overview: th-cam.com/video/Y5Els11sY1A/w-d-xo.html. How do you add and work with exteranl libraries such as say Eigen etc with remote development? There is a similar one for CUDA too but again, doesnt help with a systematic step by step approach with say setting up of debug configs in VS COde. Thanks again!

  • @Alikhan-yu5jx
    @Alikhan-yu5jx 4 ปีที่แล้ว +1

    what is g++?

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

      Ali, that's a great question. G++ is a compiler tool offered from the GNU Compiler Toolchain/Collection. This collection offers tools that allow you to compile programs for c/c++. These tools were created by the gnu project for use by everyone.

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

    I am new UwU

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

      :) you probably want the beginner concepts instead of the project playlist - th-cam.com/play/PLKMOdY6Bhga5ws13FNCbD0103pXEP-VFV.html

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

    did show how to make an dll?

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

      @Erikas Zilinskas - No, creating a dll is not covered in this video. That’s more of a Microsoft/Windows thing. This series is covered on Linux so users have a fully free open source platform where they can create a C++ program.

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

      Ah ok well thx anyway

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

    It's written g++ not found

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

      Linux or Windows?

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

      Linux

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

      @@hanzalamansoor you should install the compiler tools and libraries necessary to compile C/C++ programs. Here's on of my vids: th-cam.com/video/4e7pa6Pf3VQ/w-d-xo.html
      Make sure to destroy the like button for me ;)

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

    it looks strange. not for me

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

    too much ads man i'm not following anymore

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

      @Ramzi o - I will have to check into what the settings are, but thanks for letting me know. I don't want people getting flooded by ads and I normally choose the default setting setting. Has it been across multiple vids or just this one in particular?