I'm trying to run this example from the Wolfram website, on Linux Mint 16.
Needs["CCompilerDriver`"];
hello = CreateExecutable["
#include <stdio.h>
int main(){
printf(\"hello world\\n\");
}
", "hello"]
Import["!" <> QuoteFile[hello], "Text"]
But at the CreateExecutable call I get the message
CreateExecutable::cmperr: Compile error: collect2: error: ld returned 1 exit status
And the code returns $Failed
(plus some error messages from the Import call, that depends on CreateExecutable working).
Hello world
on Ubuntu 15.10 (Linux Mint 16 is based on Ubuntu 13.10). Did you install a c compiler? What doesCCompilers[]
return? $\endgroup$CCompilers[Full]
lists GCC. $\endgroup$printf
line and then the#include
line? $\endgroup$"ShellCommandFunction" -> Print
and"ShellOutputFunction" -> Print
. The output will tell you what is wrong. $\endgroup$