pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedincluding header files in a C extension
3+ messages / 2 participants
[nested] [flat]
* including header files in a C extension
@ 2018-08-17 17:24 TalGloz <glozmantal@gmail.com>
2018-08-20 07:03 ` Re: including header files in a C extension Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 1 reply; 3+ messages in thread
From: TalGloz @ 2018-08-17 17:24 UTC (permalink / raw)
To: pgsql-general
Hi,
If I have an external library that I install using make install into the
/usr/local/include/libraryname path by default and I want to include it in a
C extension, the Makefile for the .so file includes the headers in
/usr/local/include/libraryname path.
Can I use #include <libraryname/header.h> when writing C/CPP code for my
PostgreSQL C extension or do I have to install the external library in a
different path than /usr/local/include/libraryname. I think that the
external library headers are not getting included.
I do manage to build the .so file without error.....
Thanks,
Tal
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: including header files in a C extension
2018-08-17 17:24 including header files in a C extension TalGloz <glozmantal@gmail.com>
@ 2018-08-20 07:03 ` Laurenz Albe <laurenz.albe@cybertec.at>
2018-08-20 07:11 ` Re: including header files in a C extension TalGloz <glozmantal@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Laurenz Albe @ 2018-08-20 07:03 UTC (permalink / raw)
To: TalGloz <glozmantal@gmail.com>; pgsql-general
TalGloz wrote:
> If I have an external library that I install using make install into the
> /usr/local/include/libraryname path by default and I want to include it in a
> C extension, the Makefile for the .so file includes the headers in
> /usr/local/include/libraryname path.
>
> Can I use #include <libraryname/header.h> when writing C/CPP code for my
> PostgreSQL C extension or do I have to install the external library in a
> different path than /usr/local/include/libraryname. I think that the
> external library headers are not getting included.
>
> I do manage to build the .so file without error.....
If you can build the extension, what is your problem?
Usually you use the LDFLAGS to tell "make" where to find your headers.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: including header files in a C extension
2018-08-17 17:24 including header files in a C extension TalGloz <glozmantal@gmail.com>
2018-08-20 07:03 ` Re: including header files in a C extension Laurenz Albe <laurenz.albe@cybertec.at>
@ 2018-08-20 07:11 ` TalGloz <glozmantal@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: TalGloz @ 2018-08-20 07:11 UTC (permalink / raw)
To: pgsql-general
Hi,
Thanks for the reply but this question doesn't describe my problem. I've
asked the question again with much more detailed information about my
problem and got a solution, please see link below.
http://www.postgresql-archive.org/Linker-errors-while-creating-a-PostgreSQL-C-extension-function-td6...
<http://www.postgresql-archive.org/Linker-errors-while-creating-a-PostgreSQL-C-extension-function-td6...;
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-08-20 07:11 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17 17:24 including header files in a C extension TalGloz <glozmantal@gmail.com>
2018-08-20 07:03 ` Laurenz Albe <laurenz.albe@cybertec.at>
2018-08-20 07:11 ` TalGloz <glozmantal@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox