ebertolazzi / mexIPOPT

MATLAB interface for IPOPT
108 stars 25 forks source link

Installation Problem #19

Closed ghost closed 1 year ago

ghost commented 2 years ago

Hello, Here is the error which I received when I tried to run the CompileIpoptMexLib.m file. I am using window 11, matlab 2022. I have visual studio 2019 and 2022 installed before (just mentioned to check if there is a conflict with the IPOPT installer).


mex -largeArrayDims -Isrc ./src/ipopt.cc ./src/IpoptInterfaceCommon.cc -DOS_WIN -I../Ipopt/include_win_mingw//coin-or -output bin/windows_mingw/ipopt_win_mingw -Lbin/windows_mingw/ -lipopt -lcoinmumps Building with 'Microsoft Visual C++ 2019'. Error using mex Creating library E:\Projects\Matlab\mexIPOPT-1.1.4\toolbox\bin\windows_mingw\ipopt_win_mingw.lib and object E:\Projects\Matlab\mexIPOPT-1.1.4\toolbox\bin\windows_mingw\ipopt_win_mingw.exp ipopt.obj : error LNK2019: unresolved external symbol "public: cdecl Ipopt::IpoptApplication::IpoptApplication(bool,bool)" (??0IpoptApplication@Ipopt@@QEAA@_N0@Z) referenced in function "void __cdecl IpoptInterface::mexFunction_internal(int,struct mxArray_tag const,int,struct mxArray_tag const const)" (?mexFunction_internal@IpoptInterface@@YAXHQEAPEAUmxArray_tag@@HQEAPEBU2@@Z) ipopt.obj : error LNK2019: unresolved external symbol "public: virtual cdecl Ipopt::IpoptApplication::~IpoptApplication(void)" (??1IpoptApplication@Ipopt@@UEAA@XZ) referenced in function "void cdecl IpoptInterface::mexFunction_internal(int,struct mxArray_tag const,int,struct mxArray_tag const const)" (?mexFunction_internal@IpoptInterface@@YAXHQEAPEAUmxArray_tag@@HQEAPEBU2@@Z) ipopt.obj : error LNK2019: unresolved external symbol "public: virtual enum Ipopt::ApplicationReturnStatus __cdecl Ipopt::IpoptApplication::Initialize(bool)" (?Initialize@IpoptApplication@Ipopt@@UEAA?AW4ApplicationReturnStatus@2@_N@Z) referenced in function "void cdecl IpoptInterface::mexFunction_internal(int,struct mxArray_tag const,int,struct mxArray_tag const const)" (?mexFunction_internal@IpoptInterface@@YAXHQEAPEAUmxArray_tag@@HQEAPEBU2@@Z) ipopt.obj : error LNK2019: unresolved external symbol "public: virtual enum Ipopt::ApplicationReturnStatus cdecl Ipopt::IpoptApplication::OptimizeTNLP(class Ipopt::SmartPtr const &)" (?OptimizeTNLP@IpoptApplication@Ipopt@@UEAA?AW4ApplicationReturnStatus@2@AEBV?$SmartPtr@VTNLP@Ipopt@@@2@@Z) referenced in function "void cdecl IpoptInterface::mexFunction_internal(int,struct mxArray_tag const,int,struct mxArray_tag const const)" (?mexFunction_internal@IpoptInterface@@YAXHQEAPEAUmxArray_tag@@HQEAPEBU2@@Z) ipopt.obj : error LNK2019: unresolved external symbol "public: virtual class Ipopt::SmartPtr cdecl Ipopt::IpoptApplication::Statistics(void)" (?Statistics@IpoptApplication@Ipopt@@UEAA?AV?$SmartPtr@VSolveStatistics@Ipopt@@@2@XZ) referenced in function "void cdecl IpoptInterface::mexFunction_internal(int,struct mxArray_tag const,int,struct mxArray_tag const const)" (?mexFunction_internal@IpoptInterface@@YAXHQEAPEAUmxArray_tag@@HQEAPEBU2@@Z) IpoptInterfaceCommon.obj : error LNK2019: unresolved external symbol "public: cdecl Ipopt::Journal::Journal(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,enum Ipopt::EJournalLevel)" (??0Journal@Ipopt@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4EJournalLevel@1@@Z) referenced in function "public: cdecl Ipopt::MatlabJournal::MatlabJournal(enum Ipopt::EJournalLevel)" (??0MatlabJournal@Ipopt@@QEAA@W4EJournalLevel@1@@Z) IpoptInterfaceCommon.obj : error LNK2019: unresolved external symbol "public: virtual cdecl Ipopt::Journal::~Journal(void)" (??1Journal@Ipopt@@UEAA@XZ) referenced in function "public: virtual cdecl Ipopt::MatlabJournal::~MatlabJournal(void)" (??1MatlabJournal@Ipopt@@UEAA@XZ) IpoptInterfaceCommon.obj : error LNK2001: unresolved external symbol "public: virtual void cdecl Ipopt::Journal::SetPrintLevel(enum Ipopt::EJournalCategory,enum Ipopt::EJournalLevel)" (?SetPrintLevel@Journal@Ipopt@@UEAAXW4EJournalCategory@2@W4EJournalLevel@2@@Z) IpoptInterfaceCommon.obj : error LNK2001: unresolved external symbol "public: virtual void cdecl Ipopt::Journal::SetAllPrintLevels(enum Ipopt::EJournalLevel)" (?SetAllPrintLevels@Journal@Ipopt@@UEAAXW4EJournalLevel@2@@Z) IpoptInterfaceCommon.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl Ipopt::Journal::IsAccepted(enum Ipopt::EJournalCategory,enum Ipopt::EJournalLevel)const " (?IsAccepted@Journal@Ipopt@@UEBA_NW4EJournalCategory@2@W4EJournalLevel@2@@Z) E:\Projects\Matlab\mexIPOPT-1.1.4\toolbox\bin\windows_mingw\ipopt_win_mingw.mexw64 : fatal error LNK1120: 10 unresolved externals

Error in CompileIpoptMexLib (line 129) eval(CMD);

ebertolazzi commented 1 year ago

Now there is cmake support for compilation. Is should reduce this kind of problems.