Compiling mysql interface to Matlab on Windows Server 2003
am 02.12.2005 19:51:30 von Chris RodgersHi,
I am trying to compile a MySQL interface to Matlab. This exists as a
file mysql.cpp (download from
http://physchem.ox.ac.uk/~rodgers/mysql.cpp), which compiles fine under
linux, but I now want to get it working on Windows too.
I downloaded MySQL 3.23.58 and installed it into C:\Program Files\MySQL.
I then copied the entire contents of the "include" and "lib\opt"
directories into the same directory as my code. I know that this is a
somewhat older version of the mysql client, but this is the same version
as the server that we run here, and this is also the version that I know
works fine when compiled under Linux.
Now, when I try to compile this extension in matlab (which calls
Microsoft Visual C++ to do the actual compilation), I get several errors
(see below). Can anyone help me to get further with this?
Chris Rodgers.
The errors were:
>> mex -v -I. mysql.cpp
This is mex, Copyright 1984-2003 The MathWorks, Inc.
-> Default options filename found in C:\Documents and
Settings\rodgers\Application Data\MathWorks\MATLAB\R14
------------------------------------------------------------ ----
-> Options file = C:\Documents and
Settings\rodgers\Application Data\MathWorks\MATLAB\R14\mexopts.bat
MATLAB = C:\MATLAB704
-> COMPILER = cl
-> Compiler flags:
COMPFLAGS = -c -Zp8 -G5 -GR -W3 -DMATLAB_MEX_FILE
-nologo
OPTIMFLAGS = /MD -O2 -Oy- -DNDEBUG
DEBUGFLAGS = /MDd -Zi -Fd"mysql.pdb"
arguments = -I.
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /dll /export:mexFunction /MAP
/LIBPATH:"C:\MATLAB704\extern\lib\win32\microsoft\msvc71" libmx.lib
libmex.lib libmat.lib /implib:_lib7279.x
LINKFLAGSPOST =
Name directive = /out:"mysql.dll"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
------------------------------------------------------------ ----
--> "cl -I. -c -Zp8 -G5 -GR -W3 -DMATLAB_MEX_FILE -nologo /Fomysql.obj
-IC:\MATLAB704\extern\include -IC:\MATLAB704\simulink\include /MD -O2
-Oy- -DNDEBUG mysql.cpp"
mysql.cpp
mysql.h(127) : error C2146: syntax error : missing ';' before identifier
'alloc'
mysql.h(127) : error C2501: 'st_mysql_data::MEM_ROOT' : missing
storage-class or type specifiers
mysql.h(127) : error C2501: 'st_mysql_data::alloc' : missing
storage-class or type specifiers
mysql.h(168) : error C2146: syntax error : missing ';' before identifier
'field_alloc'
mysql.h(168) : error C2501: 'st_mysql::MEM_ROOT' : missing storage-class
or type specifiers
mysql.h(168) : error C2501: 'st_mysql::field_alloc' : missing
storage-class or type specifiers
mysql.h(184) : error C2146: syntax error : missing ';' before identifier
'field_alloc'
mysql.h(184) : error C2501: 'st_mysql_res::MEM_ROOT' : missing
storage-class or type specifiers
mysql.h(184) : error C2501: 'st_mysql_res::field_alloc' : missing
storage-class or type specifiers
mysql.cpp(152) : warning C4244: 'initializing' : conversion from
'my_ulonglong' to 'unsigned long', possible loss of data
mysql.cpp(165) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(167) : warning C4018: '>' : signed/unsigned mismatch
mysql.cpp(171) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(176) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(186) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(190) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(203) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(208) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(220) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(223) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(231) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(354) : warning C4244: 'initializing' : conversion from
'my_ulonglong' to 'unsigned long', possible loss of data
mysql.cpp(359) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(367) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(375) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(384) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(390) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(425) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(794) : warning C4244: 'initializing' : conversion from
'my_ulonglong' to 'unsigned long', possible loss of data
mysql.cpp(807) : warning C4244: 'initializing' : conversion from
'my_ulonglong' to 'unsigned long', possible loss of data
mysql.cpp(830) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(844) : warning C4018: '<' : signed/unsigned mismatch
mysql.cpp(849) : warning C4018: '<' : signed/unsigned mismatch
C:\MATLAB704\BIN\WIN32\MEX.PL: Error: Compile of 'mysql.cpp' failed.
??? Error using ==> mex
Unable to complete successfully
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org