> Why the same function writen in C, compiled with gcc works OK, but compiled
> with g++, doesn't even load? Not mentioning those written in C++.
> i.e. loader reports undefined symbol: pg_detoast_datum__FP7varlena or some
> other undefined symbol...
C++ compilers do "name mangling" to allow function overloading. If you
are going to call a C++ routine from C or most other languages, you need
to wrap the declaration for the called function in the following:
extern "C" {
retval your_function_here(arg1,arg2);
}
hth
- Thomas