Skip to content
Sign upLog in
← Back to Community

gcc compiler options

Profile icon
161134050

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 [earned 5 cycles]
View Answer
Voters
Profile icon
KaderYettoYetto
Profile icon
asivalingam
Profile icon
snowboardsheep
Profile icon
DevminiAnthony
Profile icon
20040814
Profile icon
ArnaudPuret
Profile icon
161134050
Comments
hotnewtop
Profile icon
CSharpIsGud

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

Profile icon
161134050

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

Profile icon
Augusto-Vasques

Here is an explanation with images of how to configure it but it is in Portuguese.

Profile icon
PedroSerra