Thread: I'm newbie

I'm newbie

From
"Mohsen Pahlevanzadeh"
Date:
Dears,
I'm writting a package which is pgsql-base under RH9.
I need to a small Makefile for compiling my package.
Please guide me....

Re: I'm newbie

From
Richard Huxton
Date:
Mohsen Pahlevanzadeh wrote:
> Dears,
> I'm writting a package which is pgsql-base under RH9.
> I need to a small Makefile for compiling my package.
> Please guide me....

Can you give more information about what you're trying to do?
Do you need general Makefile help, or are you having problems linking to
PostgreSQL libraries?

--
   Richard Huxton
   Archonet Ltd

Re: I'm newbie

From
"Mohsen Pahlevanzadeh"
Date:
I know about Makefile,But i need to write a Makefile that i can
communicate with pgsql & its library & header file from C++.

> Mohsen Pahlevanzadeh wrote:
>> Dears,
>> I'm writting a package which is pgsql-base under RH9.
>> I need to a small Makefile for compiling my package.
>> Please guide me....
>
> Can you give more information about what you're trying to do?
> Do you need general Makefile help, or are you having problems linking to
> PostgreSQL libraries?
>
> --
>    Richard Huxton
>    Archonet Ltd
>


Re: I'm newbie

From
Richard Huxton
Date:
Mohsen Pahlevanzadeh wrote:
> I know about Makefile,But i need to write a Makefile that i can
> communicate with pgsql & its library & header file from C++.

I'm afraid I still don't understand what you mean. If you are looking
for C++ libraries so you can access a PostgreSQL database, then you
probably want libpqxx:
   http://gborg.postgresql.org/project/libpqxx/projdisplay.php
There's an older version at:
   http://gborg.postgresql.org/project/libpqpp/projdisplay.php

There are two project sites for PostgreSQL, gborg is the older one,
pgfoundry the new one.
   http://pgfoundry.org/

Does that help at all?

--
   Richard Huxton
   Archonet Ltd

Re: I'm newbie

From
"Mohsen Pahlevanzadeh"
Date:
Dear Richard:
1.Thank you for reply
2.Dear Richard,I must write a Makefile for my client packge.But i don't
know on pgsql's library & path of its include-files.
Please guide me on writting a Makefile for a client packege with pgsql.
Yours,Mohsen
> Mohsen Pahlevanzadeh wrote:
>> I know about Makefile,But i need to write a Makefile that i can
>> communicate with pgsql & its library & header file from C++.
>
> I'm afraid I still don't understand what you mean. If you are looking
> for C++ libraries so you can access a PostgreSQL database, then you
> probably want libpqxx:
>    http://gborg.postgresql.org/project/libpqxx/projdisplay.php
> There's an older version at:
>    http://gborg.postgresql.org/project/libpqpp/projdisplay.php
>
> There are two project sites for PostgreSQL, gborg is the older one,
> pgfoundry the new one.
>    http://pgfoundry.org/
>
> Does that help at all?
>
> --
>    Richard Huxton
>    Archonet Ltd
>


Re: I'm newbie

From
Richard Huxton
Date:
Mohsen Pahlevanzadeh wrote:
> Dear Richard:
> 1.Thank you for reply
> 2.Dear Richard,I must write a Makefile for my client packge.But i don't
> know on pgsql's library & path of its include-files.

Depends on how you installed PostgreSQL. If it's via RPM then you can
see what files are installed with "rpm -ql"
  rpm -ql postgresql
  rpm -ql postgresql-libs
If you installed via source, the files you want are probably somewhere
like /usr/local/pgsql/...

> Please guide me on writting a Makefile for a client packege with pgsql.

Well, if you want a guide to developing software, you might start with:
  http://www.tldp.org/HOWTO/Software-Building-HOWTO.html

Some questions for you:
1. Do you know how to write a Makefile for your C++ application without
PostgreSQL?
2. Are you linking to other databases at the moment?
3. Do you know how/where you installed PostgreSQL?
4. Have you read the documentation on libpq in the manuals?
5. Did you download/read and documentation from the libpqxx/pp links I
provided yesterday?

--
   Richard Huxton
   Archonet Ltd

Re: I'm newbie

From
"Mohsen Pahlevanzadeh"
Date:
> Mohsen Pahlevanzadeh wrote:
>> Dear Richard:
>> 1.Thank you for reply
>> 2.Dear Richard,I must write a Makefile for my client packge.But i don't
>> know on pgsql's library & path of its include-files.
>
> Depends on how you installed PostgreSQL. If it's via RPM then you can
> see what files are installed with "rpm -ql"
>   rpm -ql postgresql
>   rpm -ql postgresql-libs
> If you installed via source, the files you want are probably somewhere
> like /usr/local/pgsql/...
>
>> Please guide me on writting a Makefile for a client packege with pgsql.
>
> Well, if you want a guide to developing software, you might start with:
>   http://www.tldp.org/HOWTO/Software-Building-HOWTO.html
>
> Some questions for you:
> 1. Do you know how to write a Makefile for your C++ application without
> PostgreSQL?
  Yes,I know.
> 2. Are you linking to other databases at the moment?
  yes.
> 3. Do you know how/where you installed PostgreSQL?
  I don't know,Becuase RH9 has it default.
> 4. Have you read the documentation on libpq in the manuals?
  yes,But i haven't found any on Makefile.
> 5. Did you download/read and documentation from the libpqxx/pp links I
> provided yesterday?
  no,Because i think it no related to my topic.

>
> --
>    Richard Huxton
>    Archonet Ltd
>


Re: I'm newbie

From
"Daniel Verite"
Date:
    Mohsen Pahlevanzadeh wrote:

> 2.Dear Richard,I must write a Makefile for my client packge.But i don't
> know on pgsql's library & path of its include-files.

You can call pg_config in your makefile.
See http://www.postgresql.org/docs/7.4/static/app-pgconfig.html
or man pg_config

--
 Daniel
 PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org