How to compile, link and use a C++ extension - Mailing list pgsql-hackers

From jacques klein
Subject How to compile, link and use a C++ extension
Date
Msg-id 55CE198C.3060203@googlemail.com
Whole thread Raw
Responses Re: How to compile, link and use a C++ extension  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hello, I want to write a "BackgroundWorker" in C++ (have lots of C++ code and libs to reuse).<br /><br /> I found   "
35.9.13Using C++ for Extensibility " in the 9.3/4 documentation who says it's possible and gives some guidelines for
source-codewriting.<br /> Compiling is not too difficult if one understands this chapter. <br /><br /> However I
coudn'tfind any doc. about how to solve the problem of linking C++ code and libs into the .so of my extension,<br />
andnothing to solve the runtime-loading problem of the c++ specific .so files ( for ex. to make work a simple usage
std::string)<br /><br /> 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.<br /><br /> I also found some rather old
(2008)message in this mailing list which addresses the same subject:<br />      <a class="moz-txt-link-freetext"
href="http://www.postgresql.org/message-id/4938E5ED.60102@acm.org">http://www.postgresql.org/message-id/4938E5ED.60102@acm.org</a><small>
:  <big>Mostly Harmless: Welcoming our C++ friends</big></small><br /> with patches that didn't reach their way into
thesource-distrib , I guess.<br /><br /> Is there something more actual about this subject that could help ?.<br /><br
/>Jacques K.<br /><br /> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Management of simple_eval_estate for plpgsql DO blocks
Next
From: Andres Freund
Date:
Subject: Re: How to compile, link and use a C++ extension