Installation on CygWin: Can't find the PostgreSQL client library (libpq)

Jacek Tomaszewski avatarJacek Tomaszewski created an issue

I use Windows 8 x64 and CygWin. The message is following:

$ gem install pg
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby.exe extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-pg
        --without-pg
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/lib
        --with-pg-config
        --without-pg-config
        --with-pg_config
        --without-pg_config
        --with-pqlib
        --without-pqlib
        --with-libpqlib
        --without-libpqlib
        --with-ms/libpqlib
        --without-ms/libpqlib


Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/pg-0.15.1 for inspect                                                                                  ion.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/pg-0.15.1/ext/gem_make.out

I've got installed postgresql, libpq5, libpq-devel by cygwin. The paths seem okay: as the log says, pq_config and libpq-fe.h are being loaded.

I have search through whole the internet and I can't find anyone with similiar issue. There are some solutions with using config path directives like 'with-pq-config=...' but it's not helping in my case.

I've tried installing older versions of pg but the newest one I can install is pg-0.9.0 .

Any guesses what causes this problem and how to fix it? I can't develop our teams' ruby project on my PC and still want to stay on Windows =S

Comments (7)

  1. larskanis

    --platform=x86-mingw32 installs a precompiled binary gem that is targeted to mingw like the OneClickInstaller and doesn't have any dependencies. I wonder that it works on cygwin - I thought that cygwin isn't binary compatible to mingw.

    Nevertheless, could you copy and paste you mkmf.log from the installation directory of the source gem? It usually allows proper diagnosis of the issue.

  2. Jacek Tomaszewski

    Here's the mkmf.log :

    find_executable: checking for pg_config... -------------------- yes
    
    --------------------
    
    find_header: checking for libpq-fe.h... -------------------- yes
    
    "gcc -o conftest -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing conftest.c  -L. -L/usr/lib -L.  -L/usr/lib -Wl,-rpath,/usr/lib     -lruby191  -lpthread -lrt -ldl -lcrypt  "
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: int main() {return 0;}
    /* end */
    
    "gcc -E -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing  conftest.c -o conftest.i"
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq-fe.h>
    /* end */
    
    --------------------
    
    find_header: checking for libpq/libpq-fs.h... -------------------- yes
    
    "gcc -E -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing  conftest.c -o conftest.i"
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq/libpq-fs.h>
    /* end */
    
    --------------------
    
    find_header: checking for pg_config_manual.h... -------------------- yes
    
    "gcc -E -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing  conftest.c -o conftest.i"
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <pg_config_manual.h>
    /* end */
    
    --------------------
    
    have_library: checking for PQconnectdb() in -lpq... -------------------- no
    
    "gcc -o conftest -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing conftest.c  -L. -L/usr/lib -L.  -L/usr/lib -Wl,-rpath,/usr/lib     -lruby191 -lpq  -lpthread -lrt -ldl -lcrypt  "
    /usr/lib/libpq.a(fe-connect.o): In function `ldapServiceLookup':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3541: undefined reference to `_ldap_init'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3553: undefined reference to `_ldap_simple_bind'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3563: undefined reference to `_ldap_result'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3576: undefined reference to `_ldap_msgfree'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3580: undefined reference to `_ldap_search_st'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3584: undefined reference to `_ldap_msgfree'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3585: undefined reference to `_ldap_err2string'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3588: undefined reference to `_ldap_unbind'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3594: undefined reference to `_ldap_count_entries'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3622: undefined reference to `_ldap_msgfree'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3623: undefined reference to `_ldap_unbind'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3569: undefined reference to `_ldap_msgfree'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3573: undefined reference to `_ldap_unbind'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3606: undefined reference to `_ldap_first_entry'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3618: undefined reference to `_ldap_get_values_len'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3628: undefined reference to `_ldap_msgfree'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3648: undefined reference to `_ldap_value_free_len'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3649: undefined reference to `_ldap_unbind'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3661: undefined reference to `_ldap_value_free_len'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-connect.c:3662: undefined reference to `_ldap_unbind'
    /usr/lib/libpq.a(fe-misc.o): In function `libpq_gettext':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-misc.c:1202: undefined reference to `_libintl_bindtextdomain'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-misc.c:1210: undefined reference to `_libintl_dgettext'
    /usr/lib/libpq.a(fe-misc.o): In function `pqSocketCheck':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-misc.c:1025: undefined reference to `_SSL_pending'
    /usr/lib/libpq.a(fe-secure.o): In function `SSLerrmessage':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1512: undefined reference to `_ERR_get_error'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1518: undefined reference to `_ERR_reason_error_string'
    /usr/lib/libpq.a(fe-secure.o): In function `initialize_SSL':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1094: undefined reference to `_SSL_CTX_use_certificate_chain_file'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1104: undefined reference to `_SSL_use_certificate_file'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1140: undefined reference to `_ENGINE_by_id'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1153: undefined reference to `_ENGINE_init'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1167: undefined reference to `_ENGINE_load_private_key'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1183: undefined reference to `_SSL_use_PrivateKey'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1253: undefined reference to `_SSL_check_private_key'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1281: undefined reference to `_SSL_CTX_load_verify_locations'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1292: undefined reference to `_SSL_CTX_get_cert_store'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1322: undefined reference to `_SSL_set_verify'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1239: undefined reference to `_SSL_use_PrivateKey_file'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1357: undefined reference to `_SSL_ctrl'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1303: undefined reference to `_X509_STORE_load_locations'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1307: undefined reference to `_X509_STORE_set_flags'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1177: undefined reference to `_ENGINE_finish'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1178: undefined reference to `_ENGINE_free'
    /usr/lib/libpq.a(fe-secure.o): In function `init_ssl_system':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:946: undefined reference to `_TLSv1_method'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:946: undefined reference to `_SSL_CTX_new'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:965: undefined reference to `_SSL_CTX_ctrl'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:929: undefined reference to `_CRYPTO_set_id_callback'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:930: undefined reference to `_CRYPTO_set_locking_callback'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:940: undefined reference to `_OPENSSL_config'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:942: undefined reference to `_SSL_library_init'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:943: undefined reference to `_SSL_load_error_strings'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:908: undefined reference to `_CRYPTO_num_locks'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:914: undefined reference to `_CRYPTO_num_locks'
    /usr/lib/libpq.a(fe-secure.o): In function `destroySSL':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:999: undefined reference to `_CRYPTO_set_locking_callback'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1000: undefined reference to `_CRYPTO_set_id_callback'
    /usr/lib/libpq.a(fe-secure.o): In function `pqsecure_write':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:490: undefined reference to `_SSL_write'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:491: undefined reference to `_SSL_get_error'
    /usr/lib/libpq.a(fe-secure.o): In function `pqsecure_read':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:329: undefined reference to `_SSL_read'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:330: undefined reference to `_SSL_get_error'
    /usr/lib/libpq.a(fe-secure.o): In function `close_SSL':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1466: undefined reference to `_SSL_shutdown'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1467: undefined reference to `_SSL_free'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1477: undefined reference to `_X509_free'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1484: undefined reference to `_ENGINE_finish'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1485: undefined reference to `_ENGINE_free'
    /usr/lib/libpq.a(fe-secure.o): In function `open_client_SSL':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1378: undefined reference to `_SSL_connect'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1432: undefined reference to `_SSL_get_peer_certificate'
    /usr/lib/libpq.a(fe-secure.o): In function `verify_peer_name_matches_certificate':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:756: undefined reference to `_X509_get_subject_name'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:756: undefined reference to `_X509_NAME_get_text_by_NID'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:772: undefined reference to `_X509_get_subject_name'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:772: undefined reference to `_X509_NAME_get_text_by_NID'
    /usr/lib/libpq.a(fe-secure.o): In function `open_client_SSL':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:1381: undefined reference to `_SSL_get_error'
    /usr/lib/libpq.a(fe-secure.o): In function `pqsecure_open_client':
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:258: undefined reference to `_SSL_new'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:259: undefined reference to `_SSL_set_ex_data'
    /pub/devel/postgresql/postgresql-9.2.4-1/src/postgresql-9.2.4/src/interfaces/libpq/fe-secure.c:260: undefined reference to `_SSL_set_fd'
    /usr/lib/libpq.a(chklocale.o): In function `pg_get_encoding_from_locale':
    /pub/devel/postgresql/postgresql-9.2.4-1/build/src/interfaces/libpq/chklocale.c:269: undefined reference to `_libintl_setlocale'
    /pub/devel/postgresql/postgresql-9.2.4-1/build/src/interfaces/libpq/chklocale.c:277: undefined reference to `_libintl_setlocale'
    /pub/devel/postgresql/postgresql-9.2.4-1/build/src/interfaces/libpq/chklocale.c:292: undefined reference to `_libintl_setlocale'
    /pub/devel/postgresql/postgresql-9.2.4-1/build/src/interfaces/libpq/chklocale.c:298: undefined reference to `_libintl_setlocale'
    /pub/devel/postgresql/postgresql-9.2.4-1/build/src/interfaces/libpq/chklocale.c:351: undefined reference to `_libintl_gettext'
    collect2: ld returned 1 exit status
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq-fe.h>
    4: 
    5: /*top*/
    6: int main() {return 0;}
    7: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
    /* end */
    
    "gcc -o conftest -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing conftest.c  -L. -L/usr/lib -L.  -L/usr/lib -Wl,-rpath,/usr/lib     -lruby191 -lpq  -lpthread -lrt -ldl -lcrypt  "
    conftest.c: In function t:
    conftest.c:7:1: error: too few arguments to function PQconnectdb
    /usr/include/libpq-fe.h:245:16: note: declared here
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq-fe.h>
    4: 
    5: /*top*/
    6: int main() {return 0;}
    7: int t() { PQconnectdb(); return 0; }
    /* end */
    
    --------------------
    
    have_library: checking for PQconnectdb() in -llibpq... -------------------- no
    
    "gcc -o conftest -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing conftest.c  -L. -L/usr/lib -L.  -L/usr/lib -Wl,-rpath,/usr/lib     -lruby191 -llibpq  -lpthread -lrt -ldl -lcrypt  "
    /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -llibpq
    collect2: ld returned 1 exit status
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq-fe.h>
    4: 
    5: /*top*/
    6: int main() {return 0;}
    7: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
    /* end */
    
    "gcc -o conftest -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing conftest.c  -L. -L/usr/lib -L.  -L/usr/lib -Wl,-rpath,/usr/lib     -lruby191 -llibpq  -lpthread -lrt -ldl -lcrypt  "
    conftest.c: In function t:
    conftest.c:7:1: error: too few arguments to function PQconnectdb
    /usr/include/libpq-fe.h:245:16: note: declared here
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq-fe.h>
    4: 
    5: /*top*/
    6: int main() {return 0;}
    7: int t() { PQconnectdb(); return 0; }
    /* end */
    
    --------------------
    
    have_library: checking for PQconnectdb() in -lms/libpq... -------------------- no
    
    "gcc -o conftest -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing conftest.c  -L. -L/usr/lib -L.  -L/usr/lib -Wl,-rpath,/usr/lib     -lruby191 -lms/libpq  -lpthread -lrt -ldl -lcrypt  "
    /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lms/libpq
    collect2: ld returned 1 exit status
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq-fe.h>
    4: 
    5: /*top*/
    6: int main() {return 0;}
    7: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectdb; return 0; }
    /* end */
    
    "gcc -o conftest -I/usr/include/ruby-1.9.1/i386-cygwin -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I.    -I/usr/include -ggdb -O2 -pipe   -fno-strict-aliasing conftest.c  -L. -L/usr/lib -L.  -L/usr/lib -Wl,-rpath,/usr/lib     -lruby191 -lms/libpq  -lpthread -lrt -ldl -lcrypt  "
    conftest.c: In function t:
    conftest.c:7:1: error: too few arguments to function PQconnectdb
    /usr/include/libpq-fe.h:245:16: note: declared here
    checked program was:
    /* begin */
    1: #include "ruby.h"
    2: 
    3: #include <libpq-fe.h>
    4: 
    5: /*top*/
    6: int main() {return 0;}
    7: int t() { PQconnectdb(); return 0; }
    /* end */
    
    --------------------
    
  3. Jacek Tomaszewski
    • changed status to open

    larskanis is right and this didn't solve the issue - mingw compiler works only with RubyInstaller on Windows, which is IMHO much worse than CygWin enviroment.

    Still looking forward to fix this bug - It's currently the last ruby library I have problems to install with on cygwin.

  4. larskanis

    I wonder why dependencies to OpenSSL, LDAP and libintl are not resolved automatically. Obviously the linker options -lcrypto -lldap -lintl are needed. Maybe something like set LDFLAGS=-lcrypto -lldap -lintl does the trick. Unfortunately none of the maintainers of ruby-pg is using CygWin, so we probably can not help promptly.

  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.