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
#include <stdio.h>
#include <math.h>
int main()
{
double x = 4.0;
double y;
y = sqrt(x);
printf("Wurzel von %lf: %lf
", x, y);
return;
}
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 to
sqrt’
collect2: error: ld returned 1 exit status
fjp@Tuxedo:~/ExponentialApproximation/EXPFJP/Programm>”
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!
Franz Polster