[erlang-questions] ODBC to Erlang data mapping problem on OS X

Chad Phillips -- Apartment Lines chad@REDACTED
Wed Dec 14 00:17:13 CET 2011


i've applied this patch to the R14B04 source code, re-ran autoconf from within lib/odbc to generate an updated configure script, then ran './configure --with-odbc=/opt/local' from the top level of the source.  however, i'm getting this:

ODBC library - link check failed

list of related symbols from the lib:

nm /opt/local/lib/libodbc.dylib | grep SQLAllocHandle
0000000000002050 T _SQLAllocHandle
0000000000002070 T _SQLAllocHandleStd
0000000000000ea0 t ___SQLAllocHandle

autoconf version: autoconf (GNU Autoconf) 2.68

oddly enough, running './configure --with-odbc=yes' properly finds the iODBC library, so i'm not really sure what's wrong here, but something definitely is not working as planned.  :)

chad

On Dec 13, 2011, at 3:23 AM, Ingela Andin wrote:

> Hi!
> 
> If think this ought to do it, as iodbc is the default and if you
> specify something it
> will not be iodbc but rather odbc.  If you mac users out there think I
> am missing something
> please let me know!
> 
> --- a/lib/odbc/configure.in
> +++ b/lib/odbc/configure.in
> @@ -135,12 +135,12 @@ AC_SUBST(TARGET_FLAGS)
>                if test ! -d "$with_odbc" || test "$with_odbc" = "yes"; then
>                    ODBC_LIB= -L"/usr/lib"
>                    ODBC_INCLUDE="-I/usr/lib/include"
> +                   AC_CHECK_LIB(iodbc,
> SQLAllocHandle,[ODBC_LIB="$ODBC_LIB -liodbc";
> odbc_lib_link_success=yes])
>                else
>                    ODBC_LIB=-L"$with_odbc/lib"
>                    ODBC_INCLUDE="-I$with_odbc/include"
> +                   AC_CHECK_LIB(odbc,
> SQLAllocHandle,[ODBC_LIB="$ODBC_LIB -lodbc";
> odbc_lib_link_success=yes])
>                fi
> -
> -               AC_CHECK_LIB(iodbc,
> SQLAllocHandle,[ODBC_LIB="$ODBC_LIB -liodbc";
> odbc_lib_link_success=yes])
>             ;;
>         win32|cygwin)
>                TARGET_FLAGS="-DWIN32"
> 
> Regards Ingela Erlang/OTP team - Ericsson AB
> 
> 
> 2011/12/11, Chad Phillips -- Apartment Lines <chad@REDACTED>:
>> Found the problem.  It's a bug in the configure scripts located in lib/odbc
>> of the Erlang source code, which hard code '-liodbc' when $host_os is darwin
>> -- this prevents anyone from being able to properly link against a unixODBC
>> install on OS X, which needs '-lodbc' instead.
>> 
>> In my case, via MacPorts, this apparently meant it was using the MacPorts
>> unixODBC headers, but linking against the default OS X iODBC lib, which I'm
>> guessing is what led to the weird behavior I was seeing.
>> 
>> I've created a patch for the MacPorts version of Erlang, but I'm pretty
>> autoconf clueless, so all it does is hard code '-lodbc' in place of
>> '-liodbc', which is clearly not the right upstream solution.  ;)
>> 
>> If there's anything else I can do to help fix this bug, please let me know.
>> 
>> Thanks,
>> 
>> Chad
>> 
>> 




More information about the erlang-questions mailing list