
Hello all, I'm having a problem compiling a HDBC-ODBC on Windows. I'm not sure if the problem is with hdbc-odbc or with the Windows GHC package or if I've done something stupid or what. Windows is not my native habitat, so forgive me if I've left out something obvious. I'm using a Cygwin shell, but I don't think that matters. As far as I can tell, the GHC package contains all the mingw stuff it needs. I'm using the GHC 6.4.2 package from http://www.haskell.org/ghc/ download_ghc_642.html on a pretty standard Windows XP setup. The compile is failing during preprocessing: it looks like hsc2hs isn't finding something. It generates a bunch of syntax errors for basic types like ULONG, etc. Any help is appreciated. Thanks. Here is the output from the attempted compile session: $ runhaskell.exe Setup.lhs configure -v Setup.lhs: Warning: No license-file field. Configuring HDBC-odbc-1.0.0.0... configure: searching for ghc in path. configure: found ghc at c:\ghc\ghc-6.4.2\bin\ghc.exe "c:\ghc\ghc-6.4.2\bin\ghc.exe" --version >tmp724 configure: looking for package tool: ghc-pkg near compiler in c:\ghc \ghc-6.4.2\b in\ghc.exe configure: found package tool in c:\ghc\ghc-6.4.2\bin\ghc-pkg.exe configure: Reading installed packages... "c:\ghc\ghc-6.4.2\bin\ghc-pkg.exe" --global list >tmp724 configure: Dependency base-any: using base-1.0 configure: Dependency mtl-any: using mtl-1.0 configure: Dependency HDBC>=1.0.0: using HDBC-1.0.0 configure: Dependency parsec-any: using parsec-1.0 configure: Using install prefix: C:\Program Files configure: Binaries installed in: C:\Program Files\HDBC-odbc-1.0.0.0 configure: Libraries installed in: C:\Program Files\Haskell\HDBC- odbc-1.0.0.0\gh c-6.4.2 configure: Private binaries installed in: C:\Program Files\HDBC- odbc-1.0.0.0 configure: Data files installed in: C:\Program Files\Common Files \HDBC-odbc-1.0. 0.0 configure: Using compiler: c:\ghc\ghc-6.4.2\bin\ghc.exe configure: Compiler flavor: GHC configure: Compiler version: 6.4.2 configure: Using package tool: c:\ghc\ghc-6.4.2\bin\ghc-pkg.exe configure: Using ar found on system at: C:\cygwin\bin\ar.exe configure: No haddock found configure: No pfesetup found configure: Using ranlib found on system at: C:\cygwin\bin\ranlib.exe configure: Using runghc found on system at: c:\ghc\ghc-6.4.2\bin \runghc.exe configure: No runhugs found configure: No happy found configure: No alex found configure: Using hsc2hs: c:\ghc\ghc-6.4.2\bin\hsc2hs.exe configure: No c2hs found configure: No cpphs found configure: No greencard found $ runhaskell.exe Setup.lhs build -v 2> log.txt Preprocessing library HDBC-odbc-1.0.0.0... c:\ghc\ghc-6.4.2\bin\hsc2hs.exe -D__GLASGOW_HASKELL__=604 -I. -o Database\HDBC\O DBC\Connection.hs Database\HDBC\ODBC\Connection.hsc ---------------------- log.txt ------------------------ In file included from c:/ghc/ghc-6.4.2/include/mingw/sql.h:13, from Database\HDBC\ODBC\Connection.hsc:41: c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:17: error: syntax error before "UDWORD" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:18: error: syntax error before "UWORD" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:24: error: syntax error before "PTR" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:25: error: syntax error before "HENV" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:26: error: syntax error before "HDBC" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:27: error: syntax error before "HSTMT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:29: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:34: error: syntax error before "SQLUINTEGER" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:36: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:37: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:50: error: syntax error before "SQLHWND" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:51: error: syntax error before "BOOKMARK" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:71: error: syntax error before "SQLTCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:90: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:94: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:96: error: syntax error before "second" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:100: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:102: error: syntax error before "hour" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:103: error: syntax error before "minute" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:104: error: syntax error before "second" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:105: error: syntax error before "fraction" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:108: error: syntax error before "SQL_DATE_STRUCT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:109: error: syntax error before "SQL_TIME_STRUCT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:110: error: syntax error before "SQL_TIMESTAMP_STRUCT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:118: error: syntax error before "SQLUINTEGER" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:122: error: syntax error before "SQLUINTEGER" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:124: error: syntax error before "minute" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:125: error: syntax error before "second" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:126: error: syntax error before "fraction" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:132: error: syntax error before "SQL_YEAR_MONTH_STRUCT" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:135: error: syntax error before '}' token c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:138: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:140: error: syntax error before "sign" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:141: error: syntax error before "val" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:142: error: syntax error before '}' token c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:154: error: syntax error before "DWORD" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:156: error: syntax error before "Data3" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:157: error: syntax error before "Data4" c:/ghc/ghc-6.4.2/include/mingw/sqltypes.h:158: error: syntax error before '}' token In file included from Database\HDBC\ODBC\Connection.hsc:41: c:/ghc/ghc-6.4.2/include/mingw/sql.h:346: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:348: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:349: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:351: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:352: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:357: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:358: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:360: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:362: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:363: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:364: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:365: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:366: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:367: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:368: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:369: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:370: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:372: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:373: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:374: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:375: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:376: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:377: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:378: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:379: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:382: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:384: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sql.h:389: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:390: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:391: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:393: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:394: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sql.h:395: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:396: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:397: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:398: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:400: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:401: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sql.h:402: error: syntax error before "SQLPOINTER" In file included from Database\HDBC\ODBC\Connection.hsc:42: c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1184: error: syntax error before "SQLHWND" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1185: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1186: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1187: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1188: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1189: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1190: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1192: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1194: error: syntax error before "SQLUINTEGER" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1195: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1196: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1197: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1198: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1199: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1200: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1201: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1202: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1203: error: syntax error before "ODBCGetTryWaitValue" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1204: error: syntax error before "ODBCSetTryWaitValue" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1207: error: syntax error before "TraceReturn" c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1208: error: syntax error before "TraceVersion" In file included from c:/ghc/ghc-6.4.2/include/mingw/sqlext.h:1214, from Database\HDBC\ODBC\Connection.hsc:42: c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:22: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:24: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:25: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:26: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:27: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:28: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:30: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:32: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:34: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:35: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:36: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:37: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:38: error: syntax error before "SQLHWND" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:39: error: syntax error before "SQLHWND" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:40: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:41: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:42: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:44: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:46: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:48: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:49: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:50: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:51: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:52: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:54: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:55: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:58: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:60: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:62: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:64: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:66: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:68: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:69: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:70: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:71: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:72: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:74: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:75: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:76: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:77: error: syntax error before "SQLUSMALLINT" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:78: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:80: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:83: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:84: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:85: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:86: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:87: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:89: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:90: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:91: error: syntax error before "SQLCHAR" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:93: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:94: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:95: error: syntax error before "SQLPOINTER" c:/ghc/ghc-6.4.2/include/mingw/sqlucode.h:96: error: syntax error before "SQLPOINTER" Database\HDBC\ODBC\Connection.hsc: In function `main': Database\HDBC\ODBC\Connection.hsc:134: error: syntax error before "int" Database\HDBC\ODBC\Connection.hsc:204: error: syntax error before "int" Database\HDBC\ODBC\Connection.hsc:212: error: syntax error before "int" Database\HDBC\ODBC\Connection.hsc:223: error: syntax error before "int" Setup.lhs: got error code while preprocessing: Database.HDBC.ODBC.Connection Rob Dockins Speak softly and drive a Sherman tank. Laugh hard; it's a long way to the bank. -- TMBG