I think that many of you use or use the Sublime Text 2 editor. I have a strange error: C ++ programs cannot be built.
My C++.sublime-build
:
{ "cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"], "working_dir": "${file_path}", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.c, source.c++", "variants": [ { "name": "Run", "cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"] } ] }
I found that when the cmd
array contains ANY substituted expressions such as ${file}
or $file
, the assembly does not start. Otherwise, it will begin.
It does not matter to the compiler. When I tried "cmd": ["notify-osd", "$file"]
, this did not work; but with "cmd": ["notify-osd", "sometexthere"]
it worked.
Manual compilation is working correctly.
My program:
#include <iostream> int main() { std::cout << "Hello World"; }
I am using Ubuntu 12.04, 32bit. Sublime Editor version: 2.0.1.
If this is not the place where I could ask this question, please tell me which one.
source share