Thread: FreeBSD -pthread -lpq problem...

FreeBSD -pthread -lpq problem...

From
Frédéric Boucher
Date:
Hi,
 
I'm trying to compile a very simply program on FreeBSD that uses the C libpq interface...  when I do like this :
 
g++ -o test test.cpp -lpq
 
it works perfectly.  But since I've made a Multi-thread version of this program, I must now include the -pthread library.  As soon as I try to compile using this :
 
g++ -o test test.cpp  -lpq -pthread
 
I receive errors :
 
/usr/lib/libc.so.4: WARNING!  setkey(3) not present in the system!
/usr/lib/libc.so.4: warning: this program uses gets(), which is unsafe.
/usr/lib/libc.so.4: warning: mktemp() possibly used unsafely; consider using mkstemp()
/usr/lib/libc.so.4: WARNING!  des_setkey(3) not present in the system!
/usr/lib/libc.so.4: WARNING!  encrypt(3) not present in the system!
/usr/lib/libc.so.4: warning: tmpnam() possibly used unsafely; consider using mkstemp()
/usr/lib/libc.so.4: warning: this program uses f_prealloc(), which is stupid.
/usr/lib/libc.so.4: WARNING!  des_cipher(3) not present in the system!
/usr/lib/libc.so.4: warning: tempnam() possibly used unsafely; consider using mkstemp()
The errors occurs only when I mix "-lpq" with "-pthread"...  if I use either one or the other, it works...  Well I need to have multi-threading capability and POSTGRES access at the same time... :(  Is this possible?  How?
 
thanks for your hint
 
Fred

Re: FreeBSD -pthread -lpq problem...

From
Peter Eisentraut
Date:
Frédéric Boucher writes:

> The errors occurs only when I mix "-lpq" with "-pthread"...  if I use
> either one or the other, it works...  Well I need to have
> multi-threading capability and POSTGRES access at the same time... :(
> Is this possible?  How?

Which PostgreSQL version?  Which FreeBSD version?

-- 
Peter Eisentraut   peter_e@gmx.net



Re: FreeBSD -pthread -lpq problem...

From
Peter Eisentraut
Date:
In src/Makefile.shlib, near

ifeq ($(PORTNAME), freebsd)

remove the line

SHLIB_LINK          += -lc

and rebuild libpq.  Or update to a more recent release, where this is
already done.

Frédéric Boucher writes:

> Postgresql v 7.1.3
> FreeBSD v 4.2-Release
>
> /fb
>
> > -----Original Message-----
> > From: Peter Eisentraut [mailto:peter_e@gmx.net]
> > Sent: 27 août, 2002 14:24
> > To: Frédéric Boucher
> > Cc: pgsql-interfaces@postgresql.org
> > Subject: Re: [INTERFACES] FreeBSD -pthread -lpq problem...
> >
> >
> > Frédéric Boucher writes:
> >
> > > The errors occurs only when I mix "-lpq" with "-pthread"...
> >  if I use
> > > either one or the other, it works...  Well I need to have
> > > multi-threading capability and POSTGRES access at the same
> > time... :(
> > > Is this possible?  How?
> >
> > Which PostgreSQL version?  Which FreeBSD version?
> >
> > --
> > Peter Eisentraut   peter_e@gmx.net
> >
> >
> >
>
>

-- 
Peter Eisentraut   peter_e@gmx.net



Re: FreeBSD -pthread -lpq problem...

From
Frédéric Boucher
Date:
Postgresql v 7.1.3
FreeBSD v 4.2-Release

/fb

> -----Original Message-----
> From: Peter Eisentraut [mailto:peter_e@gmx.net]
> Sent: 27 août, 2002 14:24
> To: Frédéric Boucher
> Cc: pgsql-interfaces@postgresql.org
> Subject: Re: [INTERFACES] FreeBSD -pthread -lpq problem...
>
>
> Frédéric Boucher writes:
>
> > The errors occurs only when I mix "-lpq" with "-pthread"...
>  if I use
> > either one or the other, it works...  Well I need to have
> > multi-threading capability and POSTGRES access at the same
> time... :(
> > Is this possible?  How?
>
> Which PostgreSQL version?  Which FreeBSD version?
>
> --
> Peter Eisentraut   peter_e@gmx.net
>
>
>