Re: How to compile, link and use a C++ extension
От | Andres Freund |
---|---|
Тема | Re: How to compile, link and use a C++ extension |
Дата | |
Msg-id | 20150814165153.GK4955@awork2.anarazel.de обсуждение исходный текст |
Ответ на | How to compile, link and use a C++ extension (jacques klein <jacques.klei@googlemail.com>) |
Ответы |
Re: How to compile, link and use a C++ extension
Re: How to compile, link and use a C++ extension |
Список | 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
В списке pgsql-hackers по дате отправления: