簡體   English   中英

HDBC -odbc與haskell連接

[英]HDBC -odbc connecting with haskell

現在我想連接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

我能為此做些什么?

您需要安裝unixodbc HDBC-odbc Haskell包裝器要鏈接的unixodbc c-library,對於Ubuntu / Debian,這是通過以下方式完成的:

sudo apt-get install unixodbc-dev

對於基於YUM / RPM的Linux發行版,這應該是必須的

sudo yum install unixODBC-devel

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM