首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HDBC -odbc与haskell连接

HDBC -odbc与haskell连接
EN

Stack Overflow用户
提问于 2011-04-22 16:04:47
回答 1查看 1.2K关注 0票数 3

现在我想连接db与haskell,我尝试安装HDBC-ODBC,HSQL-ODBC,和HDBC-mysql使用cabal,我可以配置sqlite3,我怎样才能添加这些包?当我尝试使用cabal安装它时,我得到了这个错误

代码语言:javascript
复制
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

我能为此做些什么呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-04-22 17:32:54

您需要安装Ubuntu Haskell包装器要链接到的unixodbc c库,对于Ubuntu/Debian,这是通过以下方式完成的:

代码语言:javascript
复制
sudo apt-get install unixodbc-dev

对于基于YUM/RPM的Linux发行版,这应该是一件很重要的事情

代码语言:javascript
复制
sudo yum install unixODBC-devel
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5753484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档