Skip site navigation (1) Skip section navigation (2)

Mac OS 10.4/10.5 compile issues

From: Israel Brewster <israel(at)frontierflying(dot)com>
To: pgsql-ports(at)postgresql(dot)org
Subject: Mac OS 10.4/10.5 compile issues
Date: 2008-02-06 19:36:04
Message-ID: DD23284A-8B94-451B-B58B-5667EFFB6CC3@frontierflying.com (view raw or flat)
Thread:
Lists: pgsql-ports
I am developing an application that links against libpq on Mac OS  
10.5. I want this application to be able to run on both 10.4 and 10.5.  
So far I have it working fine on my 10.5 build machine. However, when  
I try moving it to a 10.4 machine, I run into problems apparently  
related to the libpq build.

My first attempt was with a "standard" universal binary build of  
postgresql (CFLAGS="-O -g -arch i386 -arch ppc" ./configure; make;  
make install ) This produced a .dylib file that my application happily  
linked against, and ran fine on 10.5. When I move the library and  
application to 10.4, however, while the application will still launch  
and run, as soon as I try to use anything from libpq, the program  
crashes with the following error:

dyld: lazy symbol binding failed: Symbol not found: _fcntl$UNIX2003
   Referenced from: /Volumes/MIS/AssetTracker/AssetTracker.app/ 
Contents/MacOS/../Frameworks/libpq.5.dylib
   Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _fcntl$UNIX2003
   Referenced from: /Volumes/MIS/AssetTracker/AssetTracker.app/ 
Contents/MacOS/../Frameworks/libpq.5.dylib
   Expected in: /usr/lib/libSystem.B.dylib

It would appear that libpq is looking for something in the libSystem  
library that apparently exists on 10.5, but not 10.4. I figured that a  
static build of libpq should fix this problem, so I did a make  
distclean, and then re-ran the configure command with the --disable- 
shared flag to generate a static-only build. Unfortunately, this  
resulted in a slew of "undefined symbol" errors when I tried to  
compile my app. It would appear that when I don't build the shared  
libraries, my app can no longer link against libpq properly. Now,  
granted, that could be an issue with my application and not postgres  
at all, but I thought I'd ask here and see if maybe there is something  
wrong with the way I am building postgres. Thanks for any help that  
can be provided.

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------



Responses

pgsql-ports by date

Next:From: Benjamin ReedDate: 2008-02-06 20:02:46
Subject: Re: Mac OS 10.4/10.5 compile issues
Previous:From: Tom LaneDate: 2008-02-06 18:17:56
Subject: Re: ./configure problems on Fedora Core 8

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group