[Date Prev][Date Next] [Chronological] [Thread] [Top]

[OPENLDAP] iODBC + PostgreSQL ODBC compilation problem



I know this is not really a problem wth openldap but has anyone tried compiling all these successfully and when test the odbc connection, it was successful ?
  • PostgreSQL[from postgresql-8.0.1.tar.gz]
  • iODBC [from libiodbc-3.52.2.tar.gz]
  • PostgreSQL ODCB Driver[from psqlodbc-08.00.0101.tar.gz]
  • OpenLDAP[2.2.23]
  •  
    I have problem connecting with odbc[tested via /usr/local/bin/odbctest].....am worried it could be due to some compilation problem i've encountered during postgresql odbc driver...which i've rectified on my own....dunno if it was right.
     
    Hope someone out there could advise me.
     
    .sakthi
    ----- Original Message -----
    Sent: Thursday, March 17, 2005 9:14 AM
    Subject: iODBC + PostgreSQL ODBC compilation problem

    Hi,
    My problem is when I tried to test the odbc connection(/usr/local/bin/iodbctest ... DSN=PgSQL), it failed with the following error:-
    "[root@openldap2 bin]# iodbctest
    iODBC Demonstration program
    This program shows an interactive SQL processor
    Driver Manager: 03.52.0205.0204
     
    Enter ODBC connect string (? shows list):
     
    DSN                              | Driver                                 
    ------------------------------------------------------------------------------
    PgSQL                            | PostgreSQL                             
     
    Enter ODBC connect string (? shows list): DSN=PgSQL
    1: SQLDriverConnect = [iODBC][Driver Manager]/usr/local/lib/psqlodbc.so: undefined symbol: ucs2_to_utf8 (0) SQLSTATE=00000
    2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
    "
     
    I'm trying to get OpenLDAP to work with PostgreSQL. I did the installation and configuration as per link: http://www.samse.fr/GPL/ldap_pg/HOWTO/x37.html on how to get OpenLDAP to work with PostgresSQL. Please note the errors i've encountered during compilation[refer to Step3]....could that have something to do with why my connection failed ?
    The versions of softwares are:-
    • PostgreSQL[from postgresql-8.0.1.tar.gz]
    • iODBC [from libiodbc-3.52.2.tar.gz]
    • PostgreSQL ODCB Driver[from psqlodbc-08.00.0101.tar.gz]
    • OpenLDAP[2.2.23]
    Step1: Compiled PostgreSQL and created database pg_ldap and set allowed host as local connection using authentication=password [Status=OK]
    ./configure
    gmake
    su
    gmake install
    adduser postgres
    mkdir /usr/local/pgsql/data
    chown postgres /usr/local/pgsql/data
    su - postgres
    /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
    /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
    /usr/local/pgsql/bin/createdb pg_ldap
    /usr/local/pgsql/bin/psql pg_ldap
     
    Step2: Compiled iODBC [Status=OK]
    ./configure --with-iodbc-inidir=/etc
    make
    make install
     
    Step3: Compiled PostgreSQL... [Status=Failed]...the details are:-
    Action1: ./configure --with-iodbc- --with-odbcinst=/etc [Status=Failed]... the error was:-
    "checking size of long... configure: error: cannot compute sizeof (long), 77
    See `config.log' for more details."
    Resolution: Following advise in this link http://emacs-w3m.namazu.org/ml/msg07449.html, I've set export LDFLAGS='-Xlinker -R/usr/local/lib'
     
    Action1 again: ./configure --with-iodbc- --with-odbcinst=/etc  [Status=OK]
    Action2: make [Status=Failed]...the error was
    "make  all-am
    make[1]: Entering directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
    if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT odbcapi30w.lo -MD -MP -MF ".deps/odbcapi30w.Tpo" \
      -c -o odbcapi30w.lo `test -f 'odbcapi30w.c' || echo './'`odbcapi30w.c; \
    then mv -f ".deps/odbcapi30w.Tpo" ".deps/odbcapi30w.Plo"; \
    else rm -f ".deps/odbcapi30w.Tpo"; exit 1; \
    fi
     gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT odbcapi30w.lo -MD -MP -MF .deps/odbcapi30w.Tpo -c odbcapi30w.c  -fPIC -DPIC -o .libs/odbcapi30w.o
    odbcapi30w.c:238: conflicting types for `SQLColAttributeW'
    /usr/local/include/sqlucode.h:122: previous declaration of `SQLColAttributeW'
    make[1]: *** [odbcapi30w.lo] Error 1
    make[1]: Leaving directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
    make: *** [all] Error 2
    "
    Resolution: I'm not sure how to resolve this...the only thing i could think off is to comment those items. So I commented in 2 places where "SQLColAttributeW" appeared in /usr/local/include/sqlucode.h
     
    Action2 again: make [Status=Failed]...the old error disappeared but the new error was
    "make  all-am
    make[1]: Entering directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
    if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT odbcapi30.lo -MD -MP -MF ".deps/odbcapi30.Tpo" \
      -c -o odbcapi30.lo `test -f 'odbcapi30.c' || echo './'`odbcapi30.c; \
    then mv -f ".deps/odbcapi30.Tpo" ".deps/odbcapi30.Plo"; \
    else rm -f ".deps/odbcapi30.Tpo"; exit 1; \
    fi
     gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -MT odbcapi30.lo -MD -MP -MF .deps/odbcapi30.Tpo -c odbcapi30.c  -fPIC -DPIC -o .libs/odbcapi30.o
    odbcapi30.c:108: conflicting types for `SQLColAttribute'
    /usr/local/include/sql.h:840: previous declaration of `SQLColAttribute'
    make[1]: *** [odbcapi30.lo] Error 1
    make[1]: Leaving directory `/usr/src/redhat/code_to_compile_latestldap/psqlodbc-08.00.0101'
    make: *** [all] Error 2
    "
    Resolution: I'm not sure how to resolve this...the only thing i could think off is to comment those items. So I commented "SQLColAttribute" in /usr/local/include/sql.h
     
    Action2 again: make [Status=OK]
    Action3: make install
     
    Step4: Compile OpenLDAP
    Action1: ./configure --enable-sql --without-cyrus-sasl --disable-bdb --enable-crypt [Status=OK]
    Action2: make depend [Status=OK]
    Action3: make [Status=OK]
    Action4: make install [Status=OK]
     
    Step5: Test ODBC Connection
    Error as reported above.
     
    Hope you could help me.
     
    .sakthi