| От | Yuriy Rusinov |
|---|---|
| Тема | I need example of c++ function for postgres |
| Дата | |
| Msg-id | 3F0AB227.5040000@quasar.ipa.nw.ru обсуждение исходный текст |
| Список | pgsql-cygwin |
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.
В списке pgsql-cygwin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера