【问题标题】:HDBC -odbc connecting with haskellHDBC -odbc 与haskell连接
【发布时间】:2011-04-22 08:04:47
【问题描述】:

现在我想用 haskell 连接 db,我尝试使用 cabal 安装 HDBC-ODBC、HSQL-ODBC 和 HDBC-mysql,我能够配置 sqlite3,如何添加这些包?当我尝试使用 cabal 安装它时出现此错误

Resolving dependencies...
Configuring HDBC-odbc-2.2.3.2...
Preprocessing library HDBC-odbc-2.2.3.2...
Connection.hsc:47:17: error: sql.h: No such file or directory
Connection.hsc:48:20: error: sqlext.h: No such file or directory
Connection.hsc: In function ‘main’:
Connection.hsc:95: error: ‘SQL_HANDLE_ENV’ undeclared (first use in this function)
...........................................
.........................................
Connection.hsc:245: error: expected expression before ‘int’
Connection.hsc:245: error: expected ‘)’ before numeric constant
Connection.hsc:245: error: expected ‘)’ before numeric constant
compiling dist/build/Database/HDBC/ODBC/Connection_hsc_make.c failed
command was: /usr/bin/gcc -c -D__GLASGOW_HASKELL__=612 -I. -I/usr/lib/ghc-6.12.1/time-1.1.4/include -I/usr/lib/ghc-6.12.1/old-time-1.0.0.3/include -I/usr/lib/ghc-6.12.1/bytestring-0.9.1.5/include -I/usr/lib/ghc-6.12.1/base-4.2.0.0/include -I/usr/lib/ghc-6.12.1/include -I/usr/lib/ghc-6.12.1/include -I/usr/lib/ghc-6.12.1/include/ dist/build/Database/HDBC/ODBC/Connection_hsc_make.c -o dist/build/Database/HDBC/ODBC/Connection_hsc_make.o
cabal: Error: some packages failed to install:
HDBC-odbc-2.2.3.2 failed during the building phase. The exception was:
ExitFailure 1

我能做些什么呢?

【问题讨论】:

    标签: haskell-platform haskell hdbc


    【解决方案1】:

    您需要安装 HDBC-odbc Haskell 包装器想要链接的 unixodbc c-library,对于 Ubuntu/Debian,这是通过

    sudo apt-get install unixodbc-dev
    

    对于基于 YUM/RPM 的 Linux 发行版,这应该是类似的东西

    sudo yum install unixODBC-devel
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-24
      • 1970-01-01
      • 1970-01-01
      • 2013-04-25
      • 1970-01-01
      • 1970-01-01
      • 2014-05-08
      相关资源
      最近更新 更多