Re: Using shared library's

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wwwillem(at)zonnet(dot)nl
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Using shared library's
Date: 2005-11-06 16:42:49
Message-ID: 25213.1131295369@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

dawizz <wwwillem(at)zonnet(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message dawizz 2005-11-06 18:51:34 Folow up : ERROR: Could not find function
Previous Message Tom Lane 2005-11-06 16:28:17 Re: ERROR: column "datpath" does not exist