获得“sqrtof2”错误的多个定义。我试图让一个 c 程序从另一个 c 程序中获得 2 的平方根。然后使用makefile将它们带到一起。迷路了
#include <stdio.h>
#include <math.h>
#include "make2.c"
int main(void) {
double num =2.0;
// calls the sqrt function make2.c
sqrtof2(num);
printf("The sqaure root: %f", num);
return(0);
}
2nd program: make2.c
#include <stdio.h>
#include <math.h>
sqrtof2 (double num4) {
double num5 = 0;
num5= sqrt(num4);
return num5;
}
makeupfile: make3.h
#ifndef TEST_H_INCLUDED
#define TEST_H_INCLUDED
void sqrtof2(void);
#endif