From 4a27b8f43da0f3ffef05d7f0bfeaba012b5c0a86 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 18 Aug 2019 10:09:15 +0300 Subject: [PATCH] compiler: improved error, when c compiler is missing/not found. --- compiler/main.v | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/main.v b/compiler/main.v index d56761a091..652e8bff9d 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -892,6 +892,17 @@ mut args := '' ticks := time.ticks() res := os.exec(cmd) or { panic(err) } if res.exit_code != 0 { + + if res.exit_code == 127 { + // the command could not be found by the system + panic('C compiler error, while attempting to run: \n' + + '-----------------------------------------------------------\n' + + '$cmd\n' + + '-----------------------------------------------------------\n' + + 'Probably your C compiler is missing. \n' + + 'Please reinstall it, or make it available in your PATH.') + } + if v.pref.is_debug { println(res.output) } else {