Building mym on 64-bit Windows 7
3 次查看(过去 30 天)
显示 更早的评论
Has anyone been able to get mym ( http://sourceforge.net/projects/mym/ ) to build on a 64-bit Win7 machine? And if so would you mind posting or linking your steps to do so?
My particulars:
Windows 7 Enterprise, 64-bit OS
MATLAB Version 7.13.0.564 (R2011b)
Microsoft VS 2010 Ver. 10.0.30319.1
MySQL Ver 14.14 Distrib 5.5.21, for Win64 (x86)
I ran "mex -setup" and I was able to compile and run "yprime.c"
I downloaded and installed zlib ( http://www.zlib.net/ ), which is what the readme file for mym says to do.
Here is the mex command that I am using:
mex -IC:\zlib-1.2.6 -I'C:\Program Files\MySQL\Connector C 6.0.2\include' ...
-L'C:\Program Files\MySQL\Connector C 6.0.2\lib\opt' ...
-L'C:\zlib-1.2.6' -lzlib -lmysqlclient mym.cpp
I get a bunch of "already defined in MSVCRT.lib" error messages. e.g.:
LIBCMT.lib(tidtable.obj) : error LNK2005: _encoded_null already defined in MSVCRT.lib(MSVCR100.dll)
LIBCMT.lib(invarg.obj) : error LNK2005: _set_invalid_parameter_handler already defined in MSVCRT.lib(MSVCR100.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _initterm_e already defined in MSVCRT.lib(MSVCR100.dll)
I admit that I'm stumped at this point and there is not a whole lot of helpful info out there on the world wide web. Any suggestions would be greatly, and I mean greatly, appreciated.
Thanks, Bill
0 个评论
采纳的回答
William
2012-9-20
Finally got this stupid ** to work. Add COMPFLAGS="$COMPFLAGS /MT" to your command. So it should look something like:
mex -v COMPFLAGS="$COMPFLAGS /MT" -I"C:\zlib-1.2.6" -I"C:\Program Files\MySQL\Connector C 6.0.2\include" -L"C:\Program Files\MySQL\Connector C 6.0.2\lib\opt" -L"C:\zlib-1.2.6" -lzlib -lmysqlclient mym.cpp
Or, in my case:
mex -v COMPFLAGS="$COMPFLAGS /MT" -I"C:\Program Files\MySQL\MySQL Server 5.5\include" -I"C:\Program Files\zlib-1.2.7" -L"C:\Program Files\MySQL\MySQL Server 5.5\lib" -L"C:\Program Files\zlib-1.2.7" -lz -lmysqlclient mym.cpp
0 个评论
更多回答(2 个)
Karl
2012-9-20
Thanks, this was very helpful!
A couple notes:
- I had to use '-lzlib' instead of '-lz'
- Here's a discussion of the /MT switch (it causes your app to use static version of runtime library) http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.100).aspx
- I had to build zlib from source. Here's how
- Download from here: http://zlib.net/zlib127.zip
- Start...All Programs...Microsoft Visual Studio 2010...Visual Studio Tools...Visual Studio 2010 Command Prompt
- Wait for several minutes till it finishes updating environment.
- cd C:\zlib-1.2.7
- nmake -f win32/Makefile.msc
0 个评论
Matthias
2017-8-1
Thanks. I got it to work, but had to remove the
COMPFLAGS="$COMPFLAGS /MT"
So the overall command:
mex -v -I"C:\Program Files\MySQL\MySQL Server 5.7\include" -I"T:\zlib-1.2.11" -L"C:\Program Files\MySQL\MySQL Server 5.7\lib" -L"T:\zlib-1.2.11" -lzlib -lmysqlclient mym.cpp
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!