Compiling from Sublime Text (Windows 10): g++: command not found

1.5k views Asked by At

I have created a C++14.sublime-build file from tools>Build System>New Build System. The code that I placed inside is:

{
 
 "cmd":["bash", "-c", "g++ -std=c++14 -Wall '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"],
 "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
 "working_dir": "${file_path}",
 "selector": "source.c, source.c++",
 "variants":
 [
   {
     "name": "Run",
     "cmd":["bash", "-c", "g++ -std=c++14 '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
   }
 ]
}

But whenever I select C++14 from tools> Build System, an error occurs saying /bin/bash: g++: command not found

Note: The program compiles and works properly when I select C++ Single File in tools>Build System.

Please help!

0

There are 0 answers