I have the following C code:
#include <stdio.h>
#include <math.h>
int main(){
printf("Square = %d", pow(4,2));
return 0;
}
Now if I run this in the shell. I would first compile with: gcc -lm file.c -o a.out
and then run with ./a.out
.
If I run the above code in org mode within #+BEGIN_SRC C
and #+END_SRC
, I would get an error "undefined reference to pow".
Reason is that the compiling command has no link -lm
. Is there a way to add this to org-babel execution of C code?