Compiling .pgc programs gives error

Started by mike stantonabout 16 years ago2 messagesgeneral
Jump to latest
#1mike stanton
mstanton@acsa.cl

I have a problem compiling pgc programs with ecpg.
I always get the following error:

/usr/local/pgsql/lib/libpgtypes.a(timestamp.o): In function `timestamp2tm':
timestamp.c:(.text+0x2fc): undefined reference to `rint'

Version: PostgreSQL 8.3.6 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.2.4

Is this a known problem?
Any help will be useful.

Michael Stanton W.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: mike stanton (#1)
Re: Compiling .pgc programs gives error

"mike stanton" <mstanton@acsa.cl> writes:

I have a problem compiling pgc programs with ecpg.
I always get the following error:

/usr/local/pgsql/lib/libpgtypes.a(timestamp.o): In function `timestamp2tm':
timestamp.c:(.text+0x2fc): undefined reference to `rint'

Seems like you need to add "-lm" to your link command. Or consider
linking to libpgtypes.so instead of libpgtypes.a --- .so's generally
carry information about libraries they depend on, which .a's don't.

regards, tom lane