From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | jacques klein <jacques(dot)klei(at)googlemail(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: How to compile, link and use a C++ extension |
Date: | 2015-08-14 16:51:53 |
Message-ID: | 20150814165153.GK4955@awork2.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On 2015-08-14 18:38:36 +0200, jacques klein wrote:
> However I coudn't find any doc. about how to solve the problem of linking
> C++ code and libs into the .so of my extension,
> and nothing to solve the runtime-loading problem of the c++ specific .so
> files ( for ex. to make work a simple usage std::string )
libstdc++ (or whatever your platform uses) should be automatically
loaded, I don't think you'll need to worry about that.
> I started my tests by cloning the contrib/worker_spi code, and when
> transforming the code into C++, I could only note that C++ is not supported
> in the provided Makefiles.
Yes, that doesn't surprise me. Postgres itself doesn't need to care
about looking for a usable C++ compiler et al.
How exactly do you need to use the C++ code? The easiest probably would
be to have a separate object file, built using your own makefile rule,
that contains a the C++ and provides a C interface, and then use that
from a background worker purely written in C.
Greetings,
Andres Freund
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-08-14 17:28:39 | Re: How to compile, link and use a C++ extension |
Previous Message | Tom Lane | 2015-08-14 16:42:47 | Management of simple_eval_estate for plpgsql DO blocks |