It doesn't build on Ubuntu 12.04

69 views
Skip to first unread message

Hossam Hammady

unread,
Dec 4, 2014, 8:45:20 AM12/4/14
to pg-ca...@enterprisedb.com
I have libpq-dev, libpam-dev and libedit-dev,

I get this error when running make:

pgrhash.o: In function `pgrhash_create': /home/hammady/workspace/pg_catcheck/pgrhash.c:51: undefined reference to `fls' collect2: ld returned 1 exit status make: *** [pg_catcheck] Error 1

Robert Haas

unread,
Dec 4, 2014, 12:50:00 PM12/4/14
to Hossam Hammady, pg-ca...@enterprisedb.com
If you add this line:

#include "port.h"

...immediately after the include of pg_catcheck.h, does that fix it?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Hossam Hammady

unread,
Dec 7, 2014, 12:07:15 AM12/7/14
to pg-ca...@enterprisedb.com
No this doesn't fix it. Please note that it is a linker error not a compiler error, there is a missing library that you need to link to.

Hossam Hammady

unread,
Dec 7, 2014, 3:50:13 AM12/7/14
to pg-ca...@enterprisedb.com
I found that the Ubuntu port of postgres doesn't include src/port/fls.c. I have simply grabbed it from https://github.com/postgres/postgres/blob/master/src/port/fls.c and added it to the Makefile.
Now it builds with no problems!

Robert Haas

unread,
Dec 7, 2014, 10:05:37 PM12/7/14
to Hossam Hammady, pg-ca...@enterprisedb.com
On Sun, Dec 7, 2014 at 3:50 AM, Hossam Hammady <ham...@gmail.com> wrote:
> I found that the Ubuntu port of postgres doesn't include src/port/fls.c. I
> have simply grabbed it from
> https://github.com/postgres/postgres/blob/master/src/port/fls.c and added it
> to the Makefile.
> Now it builds with no problems!

Glad it's working. But I would have though that if fls() does not
exist on your platform, it would have been in pgport. I wonder why
not?

Hossam Hammady

unread,
Dec 7, 2014, 10:33:02 PM12/7/14
to Robert Haas, pg-ca...@enterprisedb.com
don't you mean src/port in the main postgres tree? No it has been removed in Ubuntu. 
--

--
Thanks
Hossam Hammady

Reply all
Reply to author
Forward
0 new messages