When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

harshit2202's blog

By harshit2202, history, 5 years ago, In English

I have been trying to run C++ file on Sublime Text 3 (Windows). I got the following sublime-build code

{ "cmd": ["g++","-std=c++14", "{file}", " - o", "{file_base_name}.exe", "&&" , "${file_base_name}.exe<inputf.in>outputf.in"], "shell":true, "working_dir":"$file_path", "selector":"source.c,source.cpp,source.c++", "path": "C:/MinGW/bin", }

But the problem is that if my code goes for TLE, it does not end the code after some time like timeout Rather it just runs infinitely and i have to open task manager to close that .exe file

Any suggestion on how to improve that?

  • Vote: I like it
  • +5
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +1 Vote: I do not like it

In Tools you have the option to "Cancel Build". That should solve your problem.

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You can install the latest version of Sublime Text. It has solved this error. It has timebound of around 5 seconds by default, you can even change it and make it as per your preference.

It shows this error when you run into an infinite loop.

timeout: the monitored command dumped core Bus error

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Brother i have latest version of sublime , but it is unregister version, Mostly my codes goes to infinite loop and hang my pc, can you please tell me how to enable this feature?

    • »
      »
      »
      4 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      Same problem,I also have the latest version.

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        As far as I know, There is no way to specify this in .sublime-build files in the new version.

»
5 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Another solution would be running your executable in new console, so you could do Ctrl+C / Ctrl+Break

I use this .sublime-build: https://paste.darkkeks.me/bb54c6c1/

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

god bhai god