My Notebook

Running C++ & Other Languages on OSX

2019-09-04 · 2 min readA quick tutorial on how to run other languages locally, instead of in an IDE or online!

This is mainly to teach people who want to learn C++ and have a Mac, or if your CS teacher told you to download Visual Studio, to compile C++. Today I'm going to show you my enviorment, because it's very flexible for a ton of languages!

  1. First things, your going to have to download Visual Studio Code or a text editor of your choice (VIM, Sublime, etc)
  2. The next thing is to download a compiler for your language to the bash, in this case it is g++, which I will show you how to do (if you don't use C++, go to step #5)
  3. Install brew by typing /usr/bin/ruby -e "$(curl -fsSL" inside your terminal, and follow on screen instructions.
  4. Then finally type in brew install g++
  5. Now you have your compiler, you can code in Visual Studio Code, then use your compiler in bash to just compile using g++ File.cpp && ./a.out and you can replace that with anything. (ex. python: python )

Now that you know how to run a file without a big junky IDE like Visual Studio, go out there and code wonders!

Thanks for reading! Liked the story? Click the heart
Created with ☕ by @neelr