2014-02-09 58 views
0

我想在我的Mac上安裝Postgres ODBC驅動程序。
我用brew安裝了postgres 8.4。安裝PostgreSQL ODBC時發生錯誤 - 找不到libpq庫

我從這裏下載了ODBC驅動程序。
http://ftp.postgresql.org/pub/odbc/versions/src/

然後我跑

./configure 

,但我得到

configure: error: libpq library not found 

但是看起來像安裝在圖書館,其實

:~/Downloads/psqlodbc-08.04.0200$ find/-name "libpq.a" 2>/dev/null 
/Library/PostgreSQL/8.4/lib/libpq.a 

這是輸出我pg_conf

:~/Downloads/psqlodbc-08.04.0200$ pg_config 
BINDIR = /Library/PostgreSQL/8.4/bin 
DOCDIR = /Library/PostgreSQL/8.4/doc/postgresql 
HTMLDIR = /Library/PostgreSQL/8.4/doc/postgresql 
INCLUDEDIR = /Library/PostgreSQL/8.4/include 
PKGINCLUDEDIR = /Library/PostgreSQL/8.4/include/postgresql 
INCLUDEDIR-SERVER = /Library/PostgreSQL/8.4/include/postgresql/server 
LIBDIR = /Library/PostgreSQL/8.4/lib 
PKGLIBDIR = /Library/PostgreSQL/8.4/lib/postgresql 
LOCALEDIR = /Library/PostgreSQL/8.4/share/locale 
MANDIR = /Library/PostgreSQL/8.4/share/man 
SHAREDIR = /Library/PostgreSQL/8.4/share/postgresql 
SYSCONFDIR = /Library/PostgreSQL/8.4/etc/postgresql 
PGXS = /Library/PostgreSQL/8.4/lib/postgresql/pgxs/src/makefiles/pgxs.mk 
CONFIGURE = '--prefix=/Users/buildfarm/pginstaller/server/staging/osx' '--with-openssl' '--with-perl' '--with-python' '--with-tcl' '--with-bonjour' '--with-pam' '--with-krb5' '--enable-thread-safety' '--with-libxml' '--with-ossp-uuid' '--with-includes=/usr/local/include/libxml2:/usr/local/include' '--docdir=/Users/buildfarm/pginstaller/server/staging/osx/doc/postgresql' '--with-libxslt' 'CFLAGS=-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -headerpad_max_install_names -arch ppc -arch i386' 'LDFLAGS=-L/usr/local/lib' 
CC = gcc -no-cpp-precomp 
CPPFLAGS = -I/usr/include/libxml2 -I/usr/local/include/libxml2 -I/usr/local/include 
CFLAGS = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -headerpad_max_install_names -arch ppc -arch i386 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv 
CFLAGS_SL = 
LDFLAGS = -L/usr/local/lib -L/usr/lib 
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lkrb5 -lz -lreadline -lm 
VERSION = PostgreSQL 8.4.18 

有什麼想法嗎?感謝您的幫助

+0

這就是* Windows *的ODBC驅動程序,你確定這是正確的鏈接?您沒有從http://ftp.postgresql.org/pub/odbc/versions/src/獲取資源?你不能通過自制軟件啓動psqlODBC嗎?見例如https://github.com/pingles/homebrew-psqlodbc –

+0

對不起,錯誤的鏈接我其實從這裏下載 http://ftp.postgresql.org/pub/odbc/versions/src/ – mottalrd

+0

用自制軟件我剛剛安裝了unixodbc,按照這裏的說明http://www.boriel.com/en/2013/01/16/postgresql-odbc-connection-from-mac-os-x/ – mottalrd

回答

1

我安裝psqlodbc-09.06.0200和我有同樣的問題,所以我安裝的PostgreSQL 9.6.2與釀造

brew install postgresql 

你會得到的libpq-dev的和的libpq庫。按照安裝:

./configure 
make 
make install 

,這一切