So You Wanna Do C++ Programming on Windows

You must update Windows 10 to the latest version before you will be able to enable the Windows Subsystem for Linux by Ubuntu (which is where you will find bash). It is best to do this over a wired connection as it will go faster and more smoothly.

Enable the subsystem:

  • Hit the Windows key and locate the Control Panel
  • Now locate the Programs and Features panel and double-click on it
  • Click the “Turn Windows features on or off” link on the left
  • Check the box for “Windows Subsystem for Linux (Beta)” and click the ok button

Enable developer mode:

  • Hit the Windows key and click the Settings gear on the left of the Start menu
  • Choose Update & Security (it’s the last entry)
  • Choose “For developers” on the left
  • Choose the “Developer mode” radio button

Setting up bash:

  • Open a command prompt (cmd), a PowerShell prompt, or a Terminal in Visual Studio Code and type bash
    • (This will cause bash will run through a basic set up.)
  • Enter new UNIX username:
    • Use your Windows username as that’s easiest to remember
  • Enter new UNIX password:
    • Use your login password for Windows again because it’s easiest
  • Retype your UNIX password:
    • Type your login password again so you’re sure it’s correct

Update Ubuntu (the subsystem which is running bash):

  • sudo apt update
    • (you will be asked to invisibly enter your password)
  • sudo apt upgrade
    • (answer y)
  • sudo apt autoremove
  • sudo apt autoclean

(Those last two are not strictly necessary but are a good practice to use. If too much time passes between any of these sudo commands you will be asked to enter your password again.)

Install the g++ compiler:

  • sudo apt install g++
    • (answer y)

The final piece of this puzzle is the (optional but pleasant enough) Code (free) version of Visual Studio.  You can get that for Windows, Mac, and Linux directly from this site.

Remember to have fun!

Share

Leave a Reply

Your email address will not be published. Required fields are marked *