现在我想将db与haskell连接,我尝试使用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
我能为此做些什么?
答案 0 :(得分:5)
您需要安装unixodbc
Haskell包装器要链接的HDBC-odbc
c-library,对于Ubuntu / Debian,这是由
sudo apt-get install unixodbc-dev
对于基于YUM / RPM的Linux发行版,这应该是
sudo yum install unixODBC-devel