How to compile and run a simple C program with Sublime Text 2?

后端 未结 5 1145
青春惊慌失措
青春惊慌失措 2020-12-02 21:58

I want to compile a simple C program with GCC. What do I need to put in the sublime-build file to do so?

5条回答
  •  情话喂你
    2020-12-02 22:15

    In windows, compile and run, with file_regex

    {
        "cmd": ["gcc", "$file_name", "-o", "${file_base_name}.exe", "&&", "${file_base_name}.exe"],
        "file_regex": "^([^:]+):([0-9]+):",
        "selector": "source.c",
        "shell": true,
        "working_dir": "$file_path"
    }
    

提交回复
热议问题