Re: Using shared library's - Mailing list pgsql-novice

From Tom Lane
Subject Re: Using shared library's
Date
Msg-id 25213.1131295369@sss.pgh.pa.us
Whole thread Raw
In response to Using shared library's  (dawizz <wwwillem@zonnet.nl>)
List pgsql-novice
dawizz <wwwillem@zonnet.nl> writes:
> and I get the error message:

> ERROR: Could not find function 'runTest'  in file '/lib/funcTest.so'

> As far as I can tell the library should be OK?

No, because you've neglected to prevent C++ name mangling of the
function name.  You need to declare it with "C" linkage.

More generally, the backend is a C engine not a C++ engine, and
you're likely to come to serious grief if you insist on trying to
use C++ libraries (like iostream) in a dynamic library.  I think
you'd be a lot better off to use gcc not g++ ...

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: column "datpath" does not exist
Next
From: dawizz
Date:
Subject: Folow up : ERROR: Could not find function