mariano / node-db-mysql

MySQL database bindings for Node.js
http://nodejsdb.org
150 stars 30 forks source link

dlopen error on Mac OSX #82

Open shockie opened 12 years ago

shockie commented 12 years ago

I have a problem using the node-db-mysql module on mac os x. On a Mountain Lion clean install everything works but on a upgraded lion -> mountain lion and a snow leopard mac, I get errors from node-waf.

Node-waf is complaining about the libmysqlclient_r.dylib:

cxx_link: build/Release/lib/node-db/binding_1.o build/Release/lib/node-db/connection_1.o build/Release/lib/node-db/events_1.o build/Release/lib/node-db/exception_1.o build/Release/lib/node-db/query_1.o build/Release/lib/node-db/result_1.o build/Release/src/connection_1.o build/Release/src/mysql_1.o build/Release/src/query_1.o build/Release/src/result_1.o build/Release/src/mysql_bindings_1.o -> build/Release/mysql_bindings.node
ld: warning: ignoring file /usr/local/mysql/lib/libmysqlclient_r.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

As it says, it tries to install it as a 32 bit architecture but the libraries are build on 64 bit architectures. Question where does node-waf defines for what architecture it should build?

If I ignore this issue and include it through a require, I receive the following error message:

dlopen(node_modules/db-mysql/build/Release/mysql_bindings.node, 1): no suitable image found.  Did find: node_modules/db-mysql/build/Release/mysql_bindings.node: mach-o, but wrong architecture
qraynaud commented 12 years ago

I believe node-waf use the architecture nodejs was built on. Install a 64bits version of nodejs instead of a 32bits version and you should be fine.