[Haskell-cafe] Build problems with HDBC-mysql on the Mac

Martijn van Steenbergen martijn at van.steenbergen.nl
Mon Nov 22 17:03:36 EST 2010


Dear cafe,

Following the instructions at 
http://matt.freels.name/2010/hdbc-mysql-os-x.html I successfully 
installed HDBC-mysql on my Mac!

However when doing a "cabal install" in a local package which depends on 
HDBC-mysql, cabal proceeds to reinstall HDBC-mysql (is this a bug? see 
my other email from a few moments ago), this time unsuccessfully because 
it is using the unpatched cached version downloaded from hackage. This 
breaks my installation: ghc-pkg list colors the package red.

Now comes the weird part. :-) I try to reinstall HDBC-mysql with my 
unpacked, patched version. It fixes my installation of HDBC-again, even 
though it exits prematurely with some errors! I've included the output 
at the end of this email.

I wonder:

Where do these errors suddenly come from? The first time the 
installation went without trouble.

How come it fixes my installation even though it reports errors?

Thank you in advance,

Martijn.



Output of "cabal install --extra-lib-dirs=/usr/local/lib:" in a local 
version of HDBC-mysql, patched according to 
http://matt.freels.name/2010/hdbc-mysql-os-x.html:

Resolving dependencies...
[1 of 1] Compiling Main             ( Setup.lhs, dist/setup/Main.o )

Setup.lhs:8:0:
     Warning: In the use of `findProgramOnPath'
              (imported from Distribution.Simple.Program):
              Deprecated: "use findProgramLocation instead"
Linking ./dist/setup/setup ...
Configuring HDBC-mysql-0.6.3...
Preprocessing library HDBC-mysql-0.6.3...
Connection.hsc:23:19: error: mysql.h: No such file or directory
Connection.hsc: In function ‘main’:
Connection.hsc:166: error: ‘MYSQL_FIELD’ undeclared (first use in this 
function)
Connection.hsc:166: error: (Each undeclared identifier is reported only once
Connection.hsc:166: error: for each function it appears in.)
Connection.hsc:170: error: expected specifier-qualifier-list before 
‘MYSQL_FIELD’
Connection.hsc:170: error: expected ‘;’ before ‘)’ token
Connection.hsc:170: error: expected statement before ‘)’ token
Connection.hsc:171: error: expected specifier-qualifier-list before 
‘MYSQL_FIELD’
Connection.hsc:171: error: expected ‘;’ before ‘)’ token
Connection.hsc:171: error: expected statement before ‘)’ token
Connection.hsc:172: error: expected specifier-qualifier-list before 
‘MYSQL_FIELD’
Connection.hsc:172: error: expected ‘;’ before ‘)’ token
Connection.hsc:172: error: expected statement before ‘)’ token
Connection.hsc:173: error: expected specifier-qualifier-list before 
‘MYSQL_FIELD’
Connection.hsc:173: error: expected ‘;’ before ‘)’ token
Connection.hsc:173: error: expected statement before ‘)’ token
Connection.hsc:174: error: expected specifier-qualifier-list before 
‘MYSQL_FIELD’
Connection.hsc:174: error: expected ‘;’ before ‘)’ token
Connection.hsc:174: error: expected statement before ‘)’ token
Connection.hsc:175: error: expected specifier-qualifier-list before 
‘MYSQL_FIELD’
Connection.hsc:175: error: expected ‘;’ before ‘)’ token
Connection.hsc:175: error: expected statement before ‘)’ token
Connection.hsc:203: error: ‘MYSQL_BIND’ undeclared (first use in this 
function)
Connection.hsc:210: error: expected specifier-qualifier-list before 
‘MYSQL_BIND’
Connection.hsc:210: error: expected ‘;’ before ‘)’ token
Connection.hsc:210: error: expected statement before ‘)’ token
Connection.hsc:211: error: expected specifier-qualifier-list before 
‘MYSQL_BIND’
Connection.hsc:211: error: expected ‘;’ before ‘)’ token
Connection.hsc:211: error: expected statement before ‘)’ token
Connection.hsc:212: error: expected specifier-qualifier-list before 
‘MYSQL_BIND’
Connection.hsc:212: error: expected ‘;’ before ‘)’ token
Connection.hsc:212: error: expected statement before ‘)’ token
Connection.hsc:213: error: expected specifier-qualifier-list before 
‘MYSQL_BIND’
Connection.hsc:213: error: expected ‘;’ before ‘)’ token
Connection.hsc:213: error: expected statement before ‘)’ token
Connection.hsc:214: error: expected specifier-qualifier-list before 
‘MYSQL_BIND’
Connection.hsc:214: error: expected ‘;’ before ‘)’ token
Connection.hsc:214: error: expected statement before ‘)’ token
Connection.hsc:215: error: expected specifier-qualifier-list before 
‘MYSQL_BIND’
Connection.hsc:215: error: expected ‘;’ before ‘)’ token
Connection.hsc:215: error: expected statement before ‘)’ token
Connection.hsc:216: error: expected specifier-qualifier-list before 
‘MYSQL_BIND’
Connection.hsc:216: error: expected ‘;’ before ‘)’ token
Connection.hsc:216: error: expected statement before ‘)’ token
Connection.hsc:228: error: ‘MYSQL_TIME’ undeclared (first use in this 
function)
Connection.hsc:232: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:232: error: expected ‘;’ before ‘)’ token
Connection.hsc:232: error: expected statement before ‘)’ token
Connection.hsc:233: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:233: error: expected ‘;’ before ‘)’ token
Connection.hsc:233: error: expected statement before ‘)’ token
Connection.hsc:234: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:234: error: expected ‘;’ before ‘)’ token
Connection.hsc:234: error: expected statement before ‘)’ token
Connection.hsc:235: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:235: error: expected ‘;’ before ‘)’ token
Connection.hsc:235: error: expected statement before ‘)’ token
Connection.hsc:236: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:236: error: expected ‘;’ before ‘)’ token
Connection.hsc:236: error: expected statement before ‘)’ token
Connection.hsc:237: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:237: error: expected ‘;’ before ‘)’ token
Connection.hsc:237: error: expected statement before ‘)’ token
Connection.hsc:242: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:242: error: expected ‘;’ before ‘)’ token
Connection.hsc:242: error: expected statement before ‘)’ token
Connection.hsc:243: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:243: error: expected ‘;’ before ‘)’ token
Connection.hsc:243: error: expected statement before ‘)’ token
Connection.hsc:244: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:244: error: expected ‘;’ before ‘)’ token
Connection.hsc:244: error: expected statement before ‘)’ token
Connection.hsc:245: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:245: error: expected ‘;’ before ‘)’ token
Connection.hsc:245: error: expected statement before ‘)’ token
Connection.hsc:246: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:246: error: expected ‘;’ before ‘)’ token
Connection.hsc:246: error: expected statement before ‘)’ token
Connection.hsc:247: error: expected specifier-qualifier-list before 
‘MYSQL_TIME’
Connection.hsc:247: error: expected ‘;’ before ‘)’ token
Connection.hsc:247: error: expected statement before ‘)’ token
Connection.hsc:368: error: ‘MYSQL_TYPE_NULL’ undeclared (first use in 
this function)
Connection.hsc:381: error: ‘MYSQL_TYPE_VAR_STRING’ undeclared (first use 
in this function)
Connection.hsc:385: error: ‘MYSQL_TYPE_LONGLONG’ undeclared (first use 
in this function)
Connection.hsc:389: error: ‘MYSQL_TYPE_TINY’ undeclared (first use in 
this function)
Connection.hsc:397: error: ‘MYSQL_TYPE_DOUBLE’ undeclared (first use in 
this function)
Connection.hsc:401: error: ‘MYSQL_TYPE_LONG’ undeclared (first use in 
this function)
Connection.hsc:422: error: ‘MYSQL_TYPE_DATETIME’ undeclared (first use 
in this function)
Connection.hsc:438: error: ‘MYSQL_TYPE_TIME’ undeclared (first use in 
this function)
Connection.hsc:492: error: ‘UNSIGNED_FLAG’ undeclared (first use in this 
function)
Connection.hsc:510: error: ‘MYSQL_TYPE_STRING’ undeclared (first use in 
this function)
Connection.hsc:512: error: ‘MYSQL_TYPE_SHORT’ undeclared (first use in 
this function)
Connection.hsc:513: error: ‘MYSQL_TYPE_INT24’ undeclared (first use in 
this function)
Connection.hsc:514: error: ‘MYSQL_TYPE_YEAR’ undeclared (first use in 
this function)
Connection.hsc:515: error: ‘MYSQL_TYPE_ENUM’ undeclared (first use in 
this function)
Connection.hsc:516: error: ‘MYSQL_TYPE_DECIMAL’ undeclared (first use in 
this function)
Connection.hsc:518: error: ‘MYSQL_TYPE_NEWDECIMAL’ undeclared (first use 
in this function)
Connection.hsc:520: error: ‘MYSQL_TYPE_FLOAT’ undeclared (first use in 
this function)
Connection.hsc:521: error: ‘MYSQL_TYPE_DATE’ undeclared (first use in 
this function)
Connection.hsc:522: error: ‘MYSQL_TYPE_TIMESTAMP’ undeclared (first use 
in this function)
Connection.hsc:523: error: ‘MYSQL_TYPE_NEWDATE’ undeclared (first use in 
this function)
Connection.hsc:524: error: ‘MYSQL_TYPE_BLOB’ undeclared (first use in 
this function)
Connection.hsc:544: error: ‘MYSQL_DATA_TRUNCATED’ undeclared (first use 
in this function)
Connection.hsc:545: error: ‘MYSQL_NO_DATA’ undeclared (first use in this 
function)
Connection.hsc:607: error: ‘NOT_NULL_FLAG’ undeclared (first use in this 
function)
Connection.hsc:629: error: ‘MYSQL_TYPE_VARCHAR’ undeclared (first use in 
this function)
Connection.hsc:630: error: ‘MYSQL_TYPE_BIT’ undeclared (first use in 
this function)
Connection.hsc:633: error: ‘MYSQL_TYPE_SET’ undeclared (first use in 
this function)
Connection.hsc:634: error: ‘MYSQL_TYPE_TINY_BLOB’ undeclared (first use 
in this function)
Connection.hsc:635: error: ‘MYSQL_TYPE_MEDIUM_BLOB’ undeclared (first 
use in this function)
Connection.hsc:636: error: ‘MYSQL_TYPE_LONG_BLOB’ undeclared (first use 
in this function)
Connection.hsc:640: error: ‘MYSQL_TYPE_GEOMETRY’ undeclared (first use 
in this function)
compiling dist/build/Database/HDBC/MySQL/Connection_hsc_make.c failed
command was: /usr/bin/gcc -c -m32 -D__GLASGOW_HASKELL__=612 
-I-L/usr/local/Cellar/readline/6.1/lib -I-arch -Ii386 
-I-L/usr/local/Cellar/mysql/5.1.51/lib/mysql -I-lmysqlclient -I-lz -I-lm 
-I/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.3/time-1.1.4/include 
-I/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.3/old-time-1.0.0.5/include 
-I/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.3/bytestring-0.9.1.7/include 
-I/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.3/base-4.2.0.2/include 
-I/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.3/include 
-I/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.3/include 
-I/Library/Frameworks/GHC.framework/Versions/612/usr/lib/ghc-6.12.3/include/ 
dist/build/Database/HDBC/MySQL/Connection_hsc_make.c -o 
dist/build/Database/HDBC/MySQL/Connection_hsc_make.o
cabal: Error: some packages failed to install:
HDBC-mysql-0.6.3 failed during the building phase. The exception was:
ExitFailure 1


More information about the Haskell-Cafe mailing list