
On Jul 12, 2007, at 23:35 , Edward Ing wrote:
Hi, I am trying to make HaskellDB work with HDBC-ODBC. I did builds of HDBC/HDBC-ODBC. But when I am building HaskellDB-HDBC-ODBC, I get the following message.
-------------- "[1 of 1] Compiling Database.HaskellDB.HDBC.ODBC ( Database/HaskellDB/HDBC/ODBC.hs, dist\build/Database/HaskellDB/HDBC/ODBC.o ) C:\Program Files\Haskell\HDBC-odbc-1.1.2.0\ghc-6.6.1/Database/HDBC/ ODBC/Connection.hi Declaration for connectODBC: Failed to load interface for `Database.HDBC.ODBC.ConnectionImpl': Use -v to see a list of the files searched for. Cannot continue after interface file error" --------------
From this, I know the problem is the linkage between Database.HDBC.ODBC.Connection and Database.HDBC.ODBC.ConnectionImple. (Also I looked at the code to see the reference.)
I did a little further investigation. I looked at the package registry area (C:\Program Files\Haskell\HDBC-odbc-1.1.2.0\ghc-6.6.1\Database\HDBC\ODBC) and notice that ConnectionImpl.hi is not there.
I went back to the build directory and did find ConnectoinImpl.hi and ConnectionImpl.o. It seems like runghc Setup.hs install, did not install ConnectionImpl.hi.
I looked into the file named ".installed-pkg-config" and I saw this:
------------ exposed-modules: Database.HDBC.ODBC hidden-modules: Database.HDBC.ODBC.Connection Database.HDBC.ODBC.Statement Database.HDBC.ODBC.Types Database.HDBC.ODBC.Utils Database.HDBC.ODBC.TypeConv import-dirs: "C:\\Program Files\\Haskell\\HDBC-odbc-1.1.2.0\ \ghc-6.6.1" library-dirs: "C:\\Program Files\\Haskell\\HDBC-odbc-1.1.2.0\ \ghc-6.6.1" hs-libraries: HSHDBC-odbc-1.1.2.0 extra-libraries: odbc32 --------------
No mention of ConnectionImple.hi. It looks like the setup up script did not install ConnectionImpl.hi.
Did ConnectionImpl.o get bound into "libHSHDBC-odbc-1.1.2.0.a" even though ConnectionImpl.hi did not get successfully installed?
Does anyone know why the install target does not install ConnectionImpl.hi and how I can get around this problem?
(Where is the odbc32 to be found anyways?)
Here are a few things I did try which did NOT work:
1. Copy ConnectionImpl.hi over manually. HaskellDB-HDBC-ODBC builds, but at runtime there is a link error.
2. Manually alter ".installed-pkg-config" to add ConnectionImpl.hi as hidden module.
Please comment on why these would not work ( I will learn from this.)
Help would be appreciated.
Hi Edward, the right approach would be to add it to other-modules in HDBC- odbc.cabal file, where it should have been all along. This is a bug in HDBC-odbc, I recommend that you send a patch to the maintainer. Approach 1 doesn't work since that does not include the .o file in the installed .a archive. Approach 2 doesn't work for several reasons, which exactly depend on what else you did, and which .installed-pkg-config file you changed. /Björn