Thread: Please help with PostgreSQL

Please help with PostgreSQL

From
Javier Reniz
Date:
I experieced problems with programming interfaces into PostgreSQL 6.5.3
(Machine: Red Hat 6.2 Standard Edition - Sucessfully Installation). I
installed this software from sources and I configure tcl and odbc extensions
and php module for Web Development and it works fine!.

But, I need create a GUI-Based Client Program in C or C++ (with GTK or
Tcl/Tk)....

I tried to compile the examples about Programming Interfaces (libpq, libpq++)
from published book about postgres but it returns an error for each call to
library "libpq-fe.h".

I don�t know if the problem is about enviroment variables (I programming as
root and/or Postgres user) or is the compilation instruction (gcc -o program.c
program.o)

Please, help me with any tip about compilation instruction for Postgres
developments and/or enviroment or another problem that you guess. ;-)

Thanks in advance. -


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1


Re: Please help with PostgreSQL

From
Cedar Cox
Date:
On 9 Jan 2001, Javier Reniz wrote:
> I tried to compile the examples about Programming Interfaces (libpq, libpq++)
> from published book about postgres but it returns an error for each call to
> library "libpq-fe.h".

What error?  Is it file not found?... This from a Jan 3 message:

-> make produces an error message saying "libpq-fe.h: No such file or
-> directory". I have found documentation around the Internet saying that
-> this file is required by programs using libpq.so but have not been able
-> to find where I can get this header file from!!
-
-Make sure you have the 'postgresql-devel' RPM installed, and set
-POSTGRES_INCLUDE to /usr/include/pgsql.

So, make sure you have the 'postgresql-devel' RPM installed.

> I don´t know if the problem is about enviroment variables (I programming as
> root and/or Postgres user) or is the compilation instruction (gcc -o program.c
> program.o)

I would suggest not programming as root.

-Cedar



Re: Please help with PostgreSQL

From
Richard Banks
Date:
<blockquote cite="cite" class="cite" type="cite"><br /> On 9 Jan 2001, Javier Reniz wrote:<br /><br /> I don´t know if
theproblem is about enviroment variables (I programming as<br /> root and/or Postgres user) or is the compilation
instruction(gcc -o program.c<br /> program.o)<br /></blockquote><br /><font face="Times New Roman, Times">try gcc -o
programprogram.c -I/usr/include/pgsql -lpq<br /><br /> You need the <i>-lpq</i> to tell the linker to reference
libpq.sofor the postgresql calls.<br /> (and get rid of the .c in your output target unless you want to overwrite your
sourcecode)<br /><br /> Richard.</font>