/ncurses_bazel

C++ Template for Bazel and ncurses

Primary LanguageC++

C++ Template for Bazel and ncurses

Can be used in Visual Studio Code

This is a starter template for building C++ binaries using ncurses library and Bazel build system.

ncurses (new curses) is a library providing a set of APIs that allows the programmer to write text-based user interfaces in a terminal-independent manner. It is a toolkit for developing "GUI-like" application software that runs under a terminal emulator. It also optimizes screen changes, in order to reduce the latency experienced when using remote shells.

Screenshot

Screenshot

How to install ncurses

Well installing ncurses library is an easy task, you just have to follow the steps listed below:

Installing ncurses on Debian/Ubuntu Linux

  1. sudo apt-get install libncurses5-dev libncursesw5-dev

Installing ncurses on Mac OS X

  1. Install Homebrew (if not already): /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install ncurses package: $brew install ncurses

Installation

You can clone this repo using this command:

git clone https://github.com/ourarash/cpp-template.git

Ubuntu Specific

If you are running on ubuntu, first copy the files in ubuntu folder int to the root of this repo:

cp ubuntu/* ./

Run main:

You can run this using blaze:

bazel run src/hello_world_scroll_main:main

Run Tests:

You can run unit tests using blaze:

bazel test tests:tests

Ncurses Cheatsheet

You can see a quick reference of ncurses APIs HERE

Installing Bazel

This repo uses Bazel for building C++ files. You can install Bazel using this link.