Search Postgresql Archives

Re: PostgreSQL C Language Extension with C++ Code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



TalGloz <glozmantal@xxxxxxxxx> writes:
> But now my compiler throws some other errors when running make:

> myfunc.cpp:29:10: error: conflicting declaration of C function ‘int64_t
> sum_of_numbers()’
>   int64_t sum_of_numbers(){
>           ^~~~~~~~~~~~~~

Well, yeah, you forgot to repeat the argument list here.  For that
matter, spelling Datum as int64_t is a recipe for trouble, even if
it works on some particular platform.  Should be

Datum sum_of_numbers(PG_FUNCTION_ARGS) { ...

> Why is it so hard to use C++ with PostgerSQL for a C extension? :)

Probably because you've failed to break your bad C++ habits.

			regards, tom lane




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux