You are not logged in.
I know that you have to use "-lm" tag on linux to include math.h lib but how do i do it in codeoss? I can manually do that but if i really wanted to do that why would i chose vscode in the first place. Here's the output
[Running] cd "/home/redacted/codeoss/" && gcc new.c -o new && "/home/redacted/codeoss/"new
/usr/bin/ld: /tmp/ccIxVWk8.o: in function `main':
new.c:(.text+0x2e): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
[Done] exited with code=1 in 0.081 seconds
, is there any way to change
gcc new.c -o new
to
gcc new.c -o new -lm
in vscode?
Last edited by W1F3B34T3R (2020-11-01 03:01:30)
Offline
Mod note:moving to Programming and Scripting
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
If you are using vscode then install "Code Runner" from the extension menu and in that code runner settings you can set those commands to compile
Offline