tags:

views:

111

answers:

1

I am trying to use the HDBC MySQL driver in my project. I seem to be having a problem related to target architecture of the processor.

ld: warning: in /usr/local/mysql/lib/libmysqlclient.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

Since it can't read the file all the external references fail to resolve.

Do I need a different version of MySQL? Or can I retarget the target architecture of my build? Personally I think that I am in the later camp as I prefer to work in pure 64 bit environment.

A: 

The issue was that GHC was 32 bit and MySQL was 64 bit. 32 bit is the currently supported GHC architecture on OS X.

See Hackage 2965 for more details on 64 bit GHC on OS X

I resolved this by uninstalling 64 bit MySQL and installing 32 bit MySQL.

Steve