include all the postgres libraries (C)

Started by Janek Sendrowskiover 12 years ago4 messagesgeneral
Jump to latest
#1Janek Sendrowski
janek12@web.de

Hi,
 
I like to try some things with C and I need certain postgres libraries for it.
This time, I'm including postgres.h for example, but postgres.h doesn't include it's files.
How do I include the whole tree, or is there a certain directory I can use.
I just want to compile and run the files for first.
 
Janek Sendrowski

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Janek Sendrowski (#1)
Re: include all the postgres libraries (C)

Janek Sendrowski <janek12@web.de> wrote:

I like to try some things with C and I need certain postgres libraries for it.
This time, I'm including postgres.h for example, but postgres.h doesn't
include it's files.
How do I include the whole tree, or is there a certain directory I can use.
I just want to compile and run the files for first.

You might want to look at the directories under the contrib
directory.  It's not clear whether you are trying to write a client
application or something that will run on the backend, but you can
find examples of both in contrib.

Depending on what you are trying to do, this section of the docs
might help:

http://www.postgresql.org/docs/9.2/interactive/server-programming.html

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Janek Sendrowski (#1)
Re: include all the postgres libraries (C)

Janek Sendrowski wrote:

Hi,
�
I like to try some things with C and I need certain postgres libraries for it.
This time, I'm including postgres.h for example, but postgres.h doesn't include it's files.
How do I include the whole tree, or is there a certain directory I can use.
I just want to compile and run the files for first.

You don't ever include all the header files we ship; most contain stuff
you don't care about. Just list the ones you really need in separate
#include lines.

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Janek Sendrowski
janek12@web.de
In reply to: Alvaro Herrera (#3)
Re: include all the postgres libraries (C)

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>I think PGXS is, what I&#39;ve been looking for.</div>

<div>&nbsp;</div>

<div>My Makefile looks like this:</div>

<div>
<div>&nbsp;PROGRAM = test<br/>
DATA = test.c<br/>
&nbsp;PG_CONFIG = pg_config<br/>
PGXS := &#36;(shell &#36;(PG_CONFIG) --pgxs)<br/>
include &#36;(PGXS)</div>

<div>&nbsp;</div>
</div>

<div>The file test.c only includes the postgres.h, but I get this error, when compiling:</div>

<div>/usr/bin/ld: cannot find -lxslt<br/>
/usr/bin/ld: cannot find -lxml2<br/>
/usr/bin/ld: cannot find -lpam<br/>
/usr/bin/ld: cannot find -ledit<br/>
collect2: ld returned 1 exit status<br/>
make: *** [test] Error 1</div>

<div>&nbsp;</div>

<div>Does anyone have an idea?</div>

<div>&nbsp;</div>

<div>Janek Sendrowski</div>
</div></div></body></html>