diff options
author | chris.sutcliffe <ctd.sutcliffe@gmail.com> | 2021-12-13 17:05:17 +0000 |
---|---|---|
committer | chris.sutcliffe <ctd.sutcliffe@gmail.com> | 2021-12-13 17:05:17 +0000 |
commit | 4f4fb2772afa9d77bc4063373ac3e83d20be06a4 (patch) | |
tree | 244bfd6182fe344a998f5a91dc411e850907ae01 /src | |
parent | 1643562e75f81eb4a5e42ae221632eaf4724275d (diff) | |
download | esotericFORTRAN-4f4fb2772afa9d77bc4063373ac3e83d20be06a4.tar.gz esotericFORTRAN-4f4fb2772afa9d77bc4063373ac3e83d20be06a4.zip |
fix maths linker error
Diffstat (limited to 'src')
-rw-r--r-- | src/Compiler/ExecuteC.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Compiler/ExecuteC.java b/src/Compiler/ExecuteC.java index 128f541..ede9bd6 100644 --- a/src/Compiler/ExecuteC.java +++ b/src/Compiler/ExecuteC.java @@ -70,14 +70,15 @@ public class ExecuteC { public Boolean compileC(){ try{ Process p; + // -lm to links maths library that is not included by default if (System.getProperty("os.name").equals("Linux")) { p = Runtime.getRuntime().exec(String.format( - "gcc %s/%s.c -o %s/%s", + "gcc %s/%s.c -o %s/%s -lm", buildToDir.toString(), filename, buildToDir.toString(), filename )); } else { p = Runtime.getRuntime().exec(String.format( - "cmd /C gcc %s -o %s", + "cmd /C gcc %s -o %s -lm", Paths.get(buildToDir.toString(), String.format("%s.c", filename)).toString(), Paths.get(buildToDir.toString(), String.format("%s.exe", filename)).toString() )); @@ -121,5 +122,9 @@ public class ExecuteC { } System.out.println(); return null; - } + } + + public static void main(String[] args) { + System.out.println("ExecuteC class testing"); + } } |