the below is a cpp program in which i am taking input from two text files.where one is a one dimensional array and other is a two dimensional array.
i will be passing these points to some other function called myRecover which is defined in other program .
i have read the first file into an array and the second into an vector.
while running the below program i am getting the error as
"/tmp/ccuQbHvq.o(.text+0x3
b7): In function `main':
: undefined reference to `myRecover(vect *, int, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)'
collect2: ld returned 1 exit status"
#include<stdio.h>
#include"deftype.h"
double a1, a2, a3, e1, e2, px, py, pz, phi, theta, psi, kx,ky,zo,curv,angle,a,b,c,
d;
extern void myRecover(struct vect list[],
int no,double a1,double a2,double a3,double e1,double e2,double px,double py,double pz,
double phi,double theta,double psi,double kx,double ky,double zo,double curv,double angle,double a,double b, double c,double d);
struct vect list[1500];
int no;
int main() {
FILE *file,*file1;
double numbers[1000];
int i,j,k,l,s,t;
file = fopen("input.txt", "r");
file1= fopen("input1.txt","r");
if((file==NULL)&&(file1==N
ULL)) {
printf("Error: can't open file.\n");
return 1;
}
else
printf("Files opened successfully.\n");
i = 0 ;
while(!feof(file)) {
fscanf(file, "%lf", &numbers[i]);
i++;
}
while(!feof(file1))
fwrite(list, sizeof ( vect ), 1500, file1 ) ;
printf("Number of numbers read from file1: %d\n", i-1);
a1=numbers[0];
a2=numbers[1];
a3=numbers[2];
e1=numbers[3];
e2=numbers[4];
px=numbers[5];
py=numbers[6];
pz=numbers[7];
phi=numbers[8];
theta=numbers[9];
psi=numbers[10];
kx=numbers[11];
ky=numbers[12];
zo=numbers[13];
curv=numbers[14];
angle=numbers[15];
a=numbers[16];
b=numbers[17];
c=numbers[18];
d=numbers[19];
printf("a1=%lf\t a2=%lf \t a3=%lf \n ",a1,a2,a3);
printf(" e1=%lf\t e2=%lf \n ",e1,e2);
printf(" px=%lf\t py=%lf \t c=%lf \n ",px,py,c);
myRecover(list,no,a1,a2,a3
,e1,e2,px,
py,pz,phi,
theta,psi,
kx,ky,zo,c
urv,angle,
a,b,c,d);
fclose(file);
fclose(file1);
return 0;
}
can any one go through the code and if possible execute it and send me the solution.i will be most thankful to u