Ask coding questions

← Back to all posts
gcc compiler options
161134050 (7)

I've included math.h in my C program, but when I press 'run' it says I have undefined references, apparently i'm supposed to compile with -lm , but how can I add compiler flags in Repl?

Answered by CSharpIsGud (395) [earned 5 cycles]
View Answer
CSharpIsGud (395)

Press F1 inside the repl, type in shell on the box that pops up, hit enter
Now in the shell type gcc filename -lm
And to run it ./a.out

161134050 (7)

@CSharpIsGud Thank you, I pressed F1 within the code section, then selected 'Open Shell' and did it from within there