system and system2 in R [Software]
not sure why your original attempt failed.
A new one, missing the IO-declaration saved as
FawltyTowers.c
int main() {
printf("Hello, world!\n");
return 0;
}
x <- system(command = "gcc -Wall -O2 FawltyTowers.c -o FawltyTowers", intern = TRUE)
print(x)
[1] "FawltyTowers.c: In function 'main':"
[2] "FawltyTowers.c:2:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]"
[3] " 2 | printf(\"Hello, world!\\n\");"
[4] " | ^~~~~~"
[5] "FawltyTowers.c:2:3: warning: incompatible implicit declaration of built-in function 'printf'"
[6] "FawltyTowers.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'"
[7] " +++ |+#include <stdio.h>"
[8] " 1 | int main() {"
FawltyTowers.c
compiled successfully to FawltyTowers.exe
, which differs from hw.exe
only in the leading bytes at addresses 00088
and 000DB
.system(command = "FawltyTowers", intern = TRUE)
[1] "Hello, world!"
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- system and system2 in R ElMaestro 2022-08-29 22:29 [Software]
- system and system2 in R Helmut 2022-08-30 01:10
- system and system2 in R ElMaestro 2022-08-30 08:52
- system and system2 in RHelmut 2022-08-30 11:25
- processx package mittyri 2022-08-31 17:50
- system and system2 in R ElMaestro 2022-08-30 08:52
- tryCatch in R mittyri 2022-08-31 17:53
- tryCatch in R ElMaestro 2022-09-01 10:33
- tryCatch in R mittyri 2022-09-01 14:07
- tryCatch in R ElMaestro 2022-09-01 10:33
- system and system2 in R Helmut 2022-08-30 01:10