Compile

Started by Andrei de Oliveira Mosmanabout 27 years ago3 messagesgeneral
Jump to latest
#1Andrei de Oliveira Mosman
commitman@digitalnet.com.br

Hi, I'm using PostgreSQL running under Linux and I must to know the command line to compile my program and link with libpq.

Tkx !

In reply to: Andrei de Oliveira Mosman (#1)
Re: [GENERAL] Compile

Hi, I'm using PostgreSQL running under Linux and I must to know the
command line to compile my program and link with libpq.

Here is peace of my Makefile:
CC=gcc
CFLAGS=-Wall
INCLUDEDIR=/usr/local/pgsql/include
LIBDIR=/usr/local/pgsql/lib
LIBOPTION=-lpq

progname: main.cxx
$(CC) -o program_name main.cpp $(CFLAGS) -I$(INCLUDEDIR) -L$(LIBDIR)
$(LIBOPTION)

-----------------
Sergei Chernev
Internet: ser@nsu.ru
Phone: +7-3832-397354

#3Simon Drabble
simon@syspac.com
In reply to: Andrei de Oliveira Mosman (#1)
Re: [GENERAL] Compile

On Sat, 6 Mar 1999, Andrei de Oliveira Mosman wrote:

Hi, I'm using PostgreSQL running under Linux and I must to know the command line to compile my program and link with libpq.

Tkx !

simply include the -lpq flag in the compiler command, e.g.

cc myprog.c -o myprog -lpq

(or add it to your makefile in the same way)

Simon.

--
"Life should come with an `Undo' button."

Simon Drabble madlather@syspac.com