Sublime Forum

ST4 cannot compile and run c++

#1

When I press CTRL+B to run the program, ST4 immediately closes the window.

Here is my compilation system code

> {
>    "encoding": "utf-8",
>    "working_dir": "$file_path",
>    "shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK \"$file_name\" -o \"$file_base_name\"",
>    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
>    "selector": "source.c++",
> 
>    "variants": 
>    [
>       {
>          "name": "Run",
>          "shell_cmd": "g++ -Wall -std=c++11 -fexec-charset=GBK \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause\""
>       }
>    ]
> }
0 Likes

#2

What do you mean by “immediately closes the window” ; which window?

What version of Sublime and which and operating system are you running? If you’re using ST4, does this also happen in Safe Mode?

0 Likes

#3

I mean the software interface for ST4 closes immediately
The ST4 version I use is 4121 and the operating system is windows10
Why go into safe mode and try ST4?

0 Likes

#4

@NovacaineT
what @OdatNurd is saying is to try starting sublime text in safe mode - perhaps the issue could be due to plugins?
how to start safe mode: https://www.sublimetext.com/docs/safe_mode.html#:~:text=Sublime%20Text%20includes%20an%20execution,and%20third-party%20packages%20unchanged.

0 Likes