[Ipopt] Ipopt 3.7.1, Matlab interface on Windows

Sebastian Nowozin nowozin at gmail.com
Thu Oct 15 12:08:03 EDT 2009


Dear Ipopt'lers,

with the updated instructions on the Ipopt homepage it is really easy
to successfully compile Ipopt 3.7.1 on Windows (Win32, Cygwin, MSVC
9.0).
However, I have been unsuccessful at compiling the Matlab interface
(R2009b), with "mex -v", obtaining the following error:

--> link /out:"ipopt.mexw32" /dll /export:mexFunction
/LIBPATH:"C:\PROGRA~1\MATLAB\R2009B\extern\lib\win32\microsoft"
libmx.lib libmex.lib libmat.lib /MACHINE:X86 kernel32.lib user32.lib
gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:NO
/implib:"C:\USERS\SENOWOZI\APPDATA\LOCAL\TEMP\MEX_TD~1\templib.x"
/MAP:"ipopt.mexw32.map"
@C:\USERS\SENOWOZI\APPDATA\LOCAL\TEMP\MEX_TD~1\MEX_TMP.RSP
C:\USERS\SENOWOZI\IPOPT-~1.1\LIB\libcoinlapack.lib
C:\USERS\SENOWOZI\IPOPT-~1.1\LIB\libcoinblas.lib
C:\USERS\SENOWOZI\IPOPT-~1.1\LIB\libipopt.lib

msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::~basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(void)"
(??1?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at XZ)
already defined in libipopt.lib(IpIpoptApplication.obj)
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(char const *)"
(??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at PBD@Z)
already defined in libipopt.lib(IpIpoptApplication.obj)
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: int __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::compare(unsigned int,unsigned int,char const
*,unsigned int)const "
(?compare@?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QBEHIIPBDI at Z)
already defined in libipopt.lib(IpIpoptApplication.obj)
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >(void)"
(??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at XZ)
already defined in libipopt.lib(IpIpoptApplication.obj)
msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class
std::locale::facet * __thiscall std::locale::facet::_Decref(void)"
(?_Decref at facet@locale at std@@QAEPAV123 at XZ) already defined in
libipopt.lib(IpIpoptApplication.obj)
libcpmt.lib(locale0.obj) : error LNK2005: "void __cdecl
_AtModuleExit(void (__cdecl*)(void))" (?_AtModuleExit@@YAXP6AXXZ at Z)
already defined in msvcprt.lib(locale0_implib.obj)
libcpmt.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)"
(?_Getgloballocale at locale@std@@CAPAV_Locimp at 12@XZ) already defined in
msvcprt.lib(MSVCP90.dll)
libcpmt.lib(locale0.obj) : error LNK2005: __Fac_tidy already defined
in msvcprt.lib(locale0_implib.obj)
libcpmt.lib(locale0.obj) : error LNK2005: "private: static void
__cdecl std::locale::facet::facet_Register(class std::locale::facet
*)" (?facet_Register at facet@locale at std@@CAXPAV123@@Z) already defined
in msvcprt.lib(locale0_implib.obj)
libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)"
(?_Locinfo_dtor at _Locinfo@std@@SAXPAV12@@Z) already defined in
msvcprt.lib(MSVCP90.dll)
libcpmt.lib(locale0.obj) : error LNK2005: "private: static class
std::locale::_Locimp * __cdecl std::locale::_Init(void)"
(?_Init at locale@std@@CAPAV_Locimp at 12@XZ) already defined in
msvcprt.lib(MSVCP90.dll)
libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl
std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(?_Locinfo_ctor at _Locinfo@std@@SAXPAV12 at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@2@@Z)
already defined in msvcprt.lib(MSVCP90.dll)
libcpmt.lib(ios.obj) : error LNK2005: "public: static void __cdecl
std::ios_base::_Addstd(class std::ios_base *)"
(?_Addstd at ios_base@std@@SAXPAV12@@Z) already defined in
msvcprt.lib(MSVCP90.dll)
libcpmt.lib(ios.obj) : error LNK2005: "private: static void __cdecl
std::ios_base::_Ios_base_dtor(class std::ios_base *)"
(?_Ios_base_dtor at ios_base@std@@CAXPAV12@@Z) already defined in
msvcprt.lib(MSVCP90.dll)
libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall
std::_Lockit::_Lockit(int)" (??0_Lockit at std@@QAE at H@Z) already defined
in msvcprt.lib(MSVCP90.dll)
libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" (??1_Lockit at std@@QAE at XZ) already defined
in msvcprt.lib(MSVCP90.dll)
LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter_noinfo
already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already
defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null already
defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already
defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crtheap.obj) : error LNK2005: __malloc_crt already defined
in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined
in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined
in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already
defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(_ctype.obj) : error LNK2005: _isspace already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(getenv.obj) : error LNK2005: _getenv already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(tolower.obj) : error LNK2005: _tolower already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)"
(?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(strtol.obj) : error LNK2005: _strtol already defined in
MSVCRT.lib(MSVCR90.dll)
   Creating library
C:\USERS\SENOWOZI\APPDATA\LOCAL\TEMP\MEX_TD~1\templib.x and object
C:\USERS\SENOWOZI\APPDATA\LOCAL\TEMP\MEX_TD~1\templib.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of
other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of
other libs; use /NODEFAULTLIB:library
libipopt.lib(xerbla.obj) : error LNK2019: unresolved external symbol
_s_stop referenced in function _xerbla_
libipopt.lib(xerbla.obj) : error LNK2019: unresolved external symbol
_e_wsfe referenced in function _xerbla_
libipopt.lib(dlamch.obj) : error LNK2001: unresolved external symbol _e_wsfe
libipopt.lib(xerbla.obj) : error LNK2019: unresolved external symbol
_do_fio referenced in function _xerbla_
libipopt.lib(dlamch.obj) : error LNK2001: unresolved external symbol _do_fio
libipopt.lib(xerbla.obj) : error LNK2019: unresolved external symbol
_s_wsfe referenced in function _xerbla_
libipopt.lib(dlamch.obj) : error LNK2001: unresolved external symbol _s_wsfe
libipopt.lib(ilaenv.obj) : error LNK2019: unresolved external symbol
_s_cmp referenced in function _ilaenv_
libipopt.lib(ilaenv.obj) : error LNK2019: unresolved external symbol
_s_copy referenced in function _ilaenv_
libipopt.lib(dsteqr.obj) : error LNK2019: unresolved external symbol
_d_sign referenced in function _dsteqr_
libipopt.lib(dsterf.obj) : error LNK2001: unresolved external symbol _d_sign
libipopt.lib(dlarfg.obj) : error LNK2001: unresolved external symbol _d_sign
libipopt.lib(dlamch.obj) : error LNK2019: unresolved external symbol
_pow_di referenced in function _dlamch_
libipopt.lib(dlartg.obj) : error LNK2001: unresolved external symbol _pow_di
libipopt.lib(iparmq.obj) : error LNK2019: unresolved external symbol
_i_nint referenced in function _iparmq_
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function ___tmainCRTStartup
ipopt.mexw32 : fatal error LNK1120: 10 unresolved externals

  C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of 'ipopt.mexw32' failed.


Did anyone in this group manage to compile and run the Matlab
interface on 32-bit Windows?

Thank you,
Sebastian



More information about the Ipopt mailing list