How to compile and run C program using Sublime Text in Ubuntu 12.04?

1

Is it possible to configure Sublime Text 2 so that it compiles a code in C and then execute and show the result in the terminal?

    
asked by anonymous 21.03.2015 / 06:55

1 answer

1

Yes, you can configure your build system. I assume you're already familiar with documentation . What you probably lack is how to create a configuration file in Linux. Probably this works:

{
    "linux":
    {
        "cmd": ["cc","-std=c99" ,"$file_name","-o", "${file_base_name}", "-lm", "-Wall", ";", "./${file_base_name}"]
    },
    "selector" : "source.c",
    "shell": true,
    "working_dir" : "$file_path",
}

Retired from this answer in the SO .

This may have to be adapted depending on how your installation is.

    
21.03.2015 / 08:58