简体   繁体   中英

MySQL and MATLAB 64 bit

I'm trying to connect to MySQL using MATLAB R2009b 64 bit and the mysql.cpp file found on the FEX and here . I followed all the steps to compile listed in the second link. After entering the following:

mex -I"C:\mysql\include" -DWIN32 mysql.cpp "C:\mysql\lib\opt\libmySQL.lib"

the mysql.mexw64 file is created in my working directory. However, when I go to test it, I get the following error:

>> mysql('status')
??? Invalid MEX-file 'C:\[path]\mysql.mexw64': C:\[path]\mysql.mexw64 is not a valid Win32 application.

I tried switching out the -DWIN32 with -DWIN64, but that just threw all sorts of errors. Anyone have a suggestion as to why this isn't working?

I'm using MATLAB R2009b 64 bit on Windows 7 64 bit.

libmysql.dll is a 32-bit library. Matlab 64-bit wants mex-files to be compiled in 64-bit mode. Unless you can recompile the library, you won't be able to get the mex-file to work, I'm afraid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM