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

Ingela Andin <>
Tue Dec 13 12:23:20 CET 2011


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 <>:
> 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