Sublime Forum

C compiler isnt working

#1

Hey there, I am completly new to programming and started learning C. Now I wanted to start programming with Sublime and after few hours I finally found out how to install all the compilers like GNU etc…

I tried using this build programm

{
“cmd” : [“gcc”, “$file_name”, “-o”, “${file_base_name}.exe”],
“selector” : “source.c”,
“shell”: true,
“working_dir” : “$file_path”,
“variants” : [

    { "name": "Run",
      "cmd" : ["${file_base_name}.exe"]
    }
]

}

But nothing happens except Sublime is putting me " [Finished in 0.3s] " out and I dont know how to fix it. I also tried using Notepadd++ and Codeblocks and nothing works. Can anyone help me?

0 Likes

#2

if your code is “perfect”, it’s expected no warning or error during compilation so nothing shows.

0 Likes

#3

#include <stdio.h>

/* A simple C program

  • Version 1.0
    /
    int main() {
    /
    Output a string */
    printf(“Hello World!”);
    return 0;
    }

this is the code. But how do I let sublime output me the code in a command window?

0 Likes

#4

There is a “Run” variant in your build settings. So, ctrl+shift+b and select Run.

0 Likes

#5

Thank you very much ! I didn’t thought the problem was that easy to solve

0 Likes