Hello, everyone !
I have developed function for postgresql, compile it, make .so-file and
when I try to link this function to a database it was an error "Cannot
find function weight_ave in <file>.so". Here is code of this function:
weight_ave.h :
#ifndef _WEIGHTAVE_H
#define _WEIGHTAVE_H
double weight_ave (const double* const w, const double* const x, int n);
#endif
weight_ave.cpp:
#include "weight_ave.h"
double weight_ave (const double* const w, const double* const x, int n)
{
double sumx=0.0;
double sumw=0.0;
for (int i=0; i<n; i++)
{
sumx+=w[i]*x[i];
sumw+=w[i];
}
return sumx/sumw;
}
what files I have to include and which way I have to declare this
function on include.
Best regards,
Sincerely yours,
Yuriy Rusinov.