Re: [HACKERS] postgres functions and C++

2000-10-08 Thread Christof Petig
"Vladimir V. Zolotych" wrote: > Hello all, > > Compile with > $ g++ -I/usr/local/qt/include -o days.so -shared days.cpp IIRC you have to compile as days.o and then link to .so: g++ -o days.o ld -shared -o days.so days.o I don't know if the compiler gets it right in one line. It might. C

Re: [HACKERS] postgres functions and C++

2000-10-04 Thread Tom Lane
"Vladimir V. Zolotych" <[EMAIL PROTECTED]> writes: > my=> select days_in_month(3, 3, 3); > ERROR: Can't find function days_in_month in file /tmp/days.so Try using 'nm' to see what symbol name is actually being exported from the .so file. I suspect that despite your use of extern "C", your C+

[HACKERS] postgres functions and C++

2000-10-04 Thread Vladimir V. Zolotych
Hello all, Please help me with create function days_in_month(int4, int4, int4) returns int4 as '/tmp/days.so' language 'c'; Can I write this function days_in_month in C++ ? I've did the following: extern "C" { int days_in_month(int year, int mo, int day); } extern "C" { int days_in_month(in