Sannis / node-mysql-libmysqlclient

Asynchronous MySQL binding for Node.js
http://sannis.github.com/node-mysql-libmysqlclient
Other
229 stars 47 forks source link

Now I can compile it in Windows, but I don't konw how to load the DLL for it #175

Closed tengattack closed 10 years ago

tengattack commented 11 years ago

So, it gave me the error:

MysqlConnectionQueued.prototype = new bindings.MysqlConnection();
                                              ^
TypeError: Cannot read property 'MysqlConnection' of null
    at Object.<anonymous> (G:\projects\wwwroot\node\node_modules\mysql-lib
mysqlclient\lib\mysql-libmysqlclient.js:208:47)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (G:\projects\wwwroot\node\src\base\db.js:3:15)
    at Object.<anonymous> (G:\projects\wwwroot\node\src\base\db.js:125:4)
    at Module._compile (module.js:456:26)
tengattack commented 11 years ago

OK, just paste libmysql.dll into the Release folder and solved it

jaxbot commented 11 years ago

Could you kindly share how you compiled it on Windows?

tengattack commented 11 years ago

@jaxbot OK, but now I'm not at home, if you have VS there have some tips: http://tengattack.com/archive/586 (Chinese)

Tomorrow I will go home and upload it there.

tengattack commented 11 years ago

@jaxbot OK, it was compiled in VS2012, maybe need VC++ Runtime (x86) http://tengattack.com/wp-content/uploads/2013/04/mysql_bindings.node-win.7z

jaxbot commented 11 years ago

@tengattack Hmm.. I have VS2012, and I tried both your binaries and the instructions on your site. For whatever reason, VS says that the platform is not supported with my installation, and using the compiled binaries results in "Not a valid Win32 application", which I suppose is due to either a different VC++ runtime version on my machine, or different bitness. Thanks for the help, though. I'll see if I can figure something out

tengattack commented 11 years ago

@jaxbot Windows8?

tengattack commented 11 years ago

MySQL on my machine also using x86 version, but I think it's unrelated.

jaxbot commented 11 years ago

@tengattack Yes, Windows 8, 64-bit

tengattack commented 11 years ago

@jaxbot maybe the file hash you need:

file mysql_bindings.node MD5: EA056982011F6CD423FAA12217D78AED SHA1: 7EFB756CE9C5E1D0C39AD4953E2B4C37D9517A40 CRC32: 28EF160E

file libmysql.dll MD5: 0B7408BF93A1FB1E15EB6FB74DA9089C SHA1: E41DB1B01C8E9C63B3A6757AC53DA059C9CFF34B CRC32: DC8F37B1

jaxbot commented 11 years ago

Checksums match from the file I have downloaded. Would it be possible, maybe, to send me your VS project and see if it will compile on my machine?

tengattack commented 11 years ago

@jaxbot in build/binding.sln and you need to change the include/lib path for MySQL include/lib files and also node include/lib path http://www.godchaos.com/mysql-libmysqlclient.7z

MD5: A67F8ED7B6D8FC739ACAC6F0C8EC6934 SHA1: EF7B14092D2803681162E6F33C9B358C5ECBD709 CRC32: 79CF7B72

jaxbot commented 11 years ago

Alright, with some trial and (mostly) error, I got it to compile against x64. If anyone comes along and needs it, I have it here: http://sdrv.ms/QfeQNt

Thanks for the help, @tengattack ! Owe you one

tengattack commented 11 years ago

@jaxbot Nice!

phouri commented 9 years ago

Many thanks for this :) @jaxbot