[erlang-questions] : ODBC library - link check failed on mac leopard
Thu Jun 26 07:23:00 CEST 2008
I have filed an issue on it, will see if it makes to R12B-4
Ingela is on vacation but I know she have other stuff on her agenda
when she comes back :-)
Geoff Cant wrote:
> "Peter Lemenkov" <> writes:
>> 2008/6/25 wenew zhang <>:
>>> error below:do you user mac now?
>> Yes, I'm a mac user.
>>> so i think macport doesn't add the odbc suports in erlang,
>> auriga:~ petro$ erl
>> Erlang (BEAM) emulator version 5.6.2 [source] [async-threads:0] [hipe]
>> Eshell V5.6.2 (abort with ^G)
>> 1> odbc:start().
>> ** exception error: undefined function odbc:start/0
> This is a problem I tend to fixup in macports - the odbc application
> needs to link (and link check) against libiodbc not libodbc. Libiodbc is
> shipped as part of Mac OS X (Tiger and Leopard I'm sure of) and provides
> the exact same API as libodbc.
> It'd be nice if there was a special case for darwin/macos in the
> configure script that would linkcheck against iodbc. Something like:
> diff --git a/lib/odbc/configure.in b/lib/odbc/configure.in
> index 114f86a..d1df895 100644
> --- a/lib/odbc/configure.in
> +++ lib/odbc/configure.in
> @@ -136,6 +136,16 @@ have_odbc_lib=no
> case $host_os in
> + darwin*)
> + TARGET_FLAGS="-DUNIX"
> + AC_CHECK_LIB(pthread, pthread_create,
> + [AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have the pthread library (-lpthread).])
> + LIBS="$LIBS -lpthread"
> + have_pthread_lib=yes])
> + ODBC_LIB=-L"/usr/lib"
> + ODBC_INCLUDE="-I/usr/lib/include"
> + AC_CHECK_LIB(iodbc, SQLAllocHandle,[ODBC_LIB="$ODBC_LIB -liodbc" odbc_lib_link_sucess=yes])
> + ;;
> AC_CHECK_LIB(ws2_32, main)
> This was prepared for R12B-2 and works :
> 1> application:start(odbc).
> Available as a git patch at (http://git.erlang.geek.nz/?p=erlang-otp.git;a=commit;h=5d71d8f6c8a5743422c9d9104574d7fa4945a912).
> Maybe something like this could be rolled into R12B-4 ?
More information about the erlang-questions