Re: [GENERAL] Problem with compiled C

From: Héctor Morales <hector(dot)morales(at)edisa(dot)com(dot)gt>
To: Charles Tassell <ctassell(at)isn(dot)net>, "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] Problem with compiled C
Date: 1999-08-12 01:23:42
Message-ID: 37B2221E.E6AFC8F7@edisa.com.gt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Charles Tassell wrote:

> >From an xterm / command prompt, type:
>
> ps auxw |grep postmaster
>
> Make sure the postmaster is running with the -i option (ie, postmaster -i
> -B 256) If you are running pgaccess on a different machine than PostGres is
> running on, you'll also have to edit the pg_hba.conf to make sure you are
> allowed to connect from the remote machine.
>
> To compile C programs you need to add the pq library, so use something like:
> gcc -o test test.c -lpq
>
> Good luck.
>
> At 04:24 PM 8/11/99, Héctor Morales wrote:
> >Hi , I have two problems.
> >
> >1. When a use pgacces, i try connect with one database, responde the
> >next error.
> > Error trying to connect to database "xxxx" on host "xxx"
> > PostgreSQL error message: Connection to database failed
> >connectDB() --connect() failed: Connection refused Is the postmaster
> >running (whit -i) at "xxx" and accepting connections on TCP/IP por
> >"5432".
> >
> > I use Postgresql 6.5, on RedHat 6. I don't know why not connect.
> >
> >2. When i compiled one program in C, I don't Know what parameter i use
> >with gcc
> >but i compilied the example of the testc.c in manual of programmer no
> >indicate How to compiled.
> >
> >
> >Thanks for yor help.
> >
> >
> >

Excellent pgaccess work is great.

So when I compiled my program in C use
gcc -o prueba prueba.c -llibpq.so

responde
/usr/bin/ld: cannot open -llibpg.so : no such file or directory
collect2: ld returned 1 exit status

I probe with
gcc -o prueba prueba.c -llibpq.so -L/usr/lib

But equal , I sure that the library is in this directory and a observe the
LD_LIBRARY_PATH and the directory is in this variable.

So i don't Know why not compiled.

Thanks

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Emily Foster 1999-08-12 02:11:07
Previous Message Charles Tassell 1999-08-11 23:12:33 Re: [GENERAL] Problem with compiled C