Reputation: 916
Now I want to connect db with haskell,I tried to install HDBC-ODBC,HSQL-ODBC,and HDBC-mysql using cabal,I was able to configure sqlite3,How I can add these package? I'm getting this error when I try to install it using 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
What can I do for this?
Upvotes: 3
Views: 1218
Reputation: 7825
You need to install the unixodbc
c-library which the HDBC-odbc
Haskell wrapper wants to link against, for Ubuntu/Debian this is accomplished by
sudo apt-get install unixodbc-dev
For YUM/RPM based Linux distribution this should be something along
sudo yum install unixODBC-devel
Upvotes: 5