C programming - undefined reference to `sqrt'
I am about to start work on mathematical software with Leap 15.1using C. I ran into the following (elementary?!) problem: Compilation of the following C-program test.c
double x = 4.0;
y = sqrt(x);
printf("Wurzel von %lf: %lf\n", x, y);
using command "gcc -ansi -pedantic test.c -o test.exe" results in the error message
"/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /tmp/ccGo2pR5.o: in function
main': test.c:(.text+0x23): undefined reference tosqrt'
collect2: error: ld returned 1 exit status
What can I do to correct this situation? The issue seems to the header file math.h.
My Leap 15.1 installation was done with yast2
Thanks in advance!