Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  problem with IloOplModel class IloOplImplMissing

    Posted 01/13/13 02:26 AM

    Originally posted by: SystemAdmin


    Hi I am trying to implement a program to run multiple instance of my model using c++. this part of the code is the one where I read the input data. I always get errors in the function

    #include "stdafx.h"
    #include "Info.h"
    #include <ilopl/iloopl.h>
    #include <ilcplex/ilocplex.h>
    //#include <ilcplex/ilocplex.h>
    #include <sstream>
    void CInfo::readInfo(char * szMod, char * szDat)
    {
    IloEnv env;
    IloCplex cplex(env);

    int status = 127;
    try {
    IloOplErrorHandler handler(env,cout);
    IloOplSettings settings(env,handler);
    IloOplModelSource modelSource(env,szMod);
    IloOplModelDefinition def(modelSource,handler);
    IloOplDataSource dataSource1(env,szDat);
    IloOplModel opl(def,cplex); //IloOplModel opl(def,cplex);
    opl.addDataSource(dataSource1);

    opl.generate();
    if (cplex.solve())
    opl.postProcess();

    nProb = opl.getElement("nProb").asInt();
    IloIntMap oplItem = opl.getElement("nItem").asIntMap(); //
    IloIntMap oplTime = opl.getElement("nTime").asIntMap();
    IloIntMap oplSC = opl.getElement("setupCoeff").asIntMap();
    IloIntMap oplCU = opl.getElement("capUtil").asIntMap();
    IloIntMap oplTSeq = opl.getElement("timeTSP").asIntMap();
    IloIntMap oplTCoeff = opl.getElement("timeLP").asIntMap();

    for (IloInt i=1; i<=nProb; i++)
    {
    nItem.push_back(oplItem.get(i));
    nTime.push_back(oplTime.get(i));
    setupCoeff.push_back(oplSC.get(i));
    capUtil.push_back(oplCU.get(i));
    timeSeq.push_back(oplTSeq.get(i));
    timeCoeff.push_back(oplTCoeff.get(i));
    }

    }
    catch( IloException & e )
    {
    cout << "### exception: ";
    e.print(cout);
    status = 2;
    }
    catch (...)
    {
    cout << "### UNEXPECTED ERROR ..." << endl;
    status = 3;
    }

    env.end();
    }

    this are the errors message i have.

    Could someone please tell me what is going on here, I am spending two weeks trying to del with this issue.
    Error 67 error LNK2019: unresolved external symbol "public: __thiscall IloOplImplMissing::IloOplImplMissing(char const *,int)" (??0IloOplImplMissing@@QAE@PBDH@Z) referenced in function "public: class IloOplErrorHandlerI & __thiscall IloOplErrorHandler::impl(void)" (?impl@IloOplErrorHandler@@QAEAAVIloOplErrorHandlerI@@XZ) Info.obj
    Error 68 error LNK2001: unresolved external symbol "public: virtual __thiscall IloOplImplMissing::~IloOplImplMissing(void)" (??1IloOplImplMissing@@UAE@XZ) Info.obj
    Error 69 error LNK2001: unresolved external symbol "public: __thiscall IloOplImplMissing::IloOplImplMissing(class IloOplImplMissing const &)" (??0IloOplImplMissing@@QAE@ABV0@@Z) Info.obj
    Error 70 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall IloOplException::getMessage(void)const " (?getMessage@IloOplException@@UBEPBDXZ) Info.obj
    Error 71 error LNK2001: unresolved external symbol "public: virtual class IloOplLocation __thiscall IloOplException::getLocation(void)const " (?getLocation@IloOplException@@UBE?AVIloOplLocation@@XZ) Info.obj
    Error 72 error LNK2019: unresolved external symbol "public: __thiscall IloOplDefaultErrorHandlerI::IloOplDefaultErrorHandlerI(class IloEnvI *,class std::basic_ostream<char,struct std::char_traits<char> > &)" (??0IloOplDefaultErrorHandlerI@@QAE@PAVIloEnvI@@AAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) referenced in function "public: __thiscall IloOplErrorHandler::IloOplErrorHandler(class IloEnv,class std::basic_ostream<char,struct std::char_traits<char> > &)" (??0IloOplErrorHandler@@QAE@VIloEnv@@AAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) Info.obj
    Error 73 error LNK2019: unresolved external symbol "private: void __thiscall IloOplSettingsI::incrementRefCount(void)" (?incrementRefCount@IloOplSettingsI@@AAEXXZ) referenced in function "public: __thiscall IloOplSettings::IloOplSettings(class IloEnv,class IloOplErrorHandler)" (??0IloOplSettings@@QAE@VIloEnv@@VIloOplErrorHandler@@@Z) Info.obj
    Error 74 error LNK2019: unresolved external symbol "public: __thiscall IloOplSettingsI::IloOplSettingsI(class IloEnvI *,class IloOplErrorHandlerI &)" (??0IloOplSettingsI@@QAE@PAVIloEnvI@@AAVIloOplErrorHandlerI@@@Z) referenced in function "public: __thiscall IloOplSettings::IloOplSettings(class IloEnv,class IloOplErrorHandler)" (??0IloOplSettings@@QAE@VIloEnv@@VIloOplErrorHandler@@@Z) Info.obj
    Error 75 error LNK2019: unresolved external symbol "public: __thiscall IloOplModelSourceI::IloOplModelSourceI(class IloEnvI *,char const *)" (??0IloOplModelSourceI@@QAE@PAVIloEnvI@@PBD@Z) referenced in function "public: __thiscall IloOplModelSource::IloOplModelSource(class IloEnv,char const *)" (??0IloOplModelSource@@QAE@VIloEnv@@PBD@Z) Info.obj
    Error 76 error LNK2019: unresolved external symbol "public: __thiscall IloOplDataFileReaderI::IloOplDataFileReaderI(class IloEnvI *,char const *)" (??0IloOplDataFileReaderI@@QAE@PAVIloEnvI@@PBD@Z) referenced in function "public: __thiscall IloOplDataSource::IloOplDataSource(class IloEnv,char const *)" (??0IloOplDataSource@@QAE@VIloEnv@@PBD@Z) Info.obj
    Error 77 error LNK2019: unresolved external symbol "public: void __thiscall IloOplModelI::addDataSource(class IloOplDataSourceI &)" (?addDataSource@IloOplModelI@@QAEXAAVIloOplDataSourceI@@@Z) referenced in function "public: void __thiscall IloOplModel::addDataSource(class IloOplDataSource)" (?addDataSource@IloOplModel@@QAEXVIloOplDataSource@@@Z) Info.obj
    Error 78 error LNK2019: unresolved external symbol "public: class IloOplElementI & __thiscall IloOplModelI::getElement(char const *)" (?getElement@IloOplModelI@@QAEAAVIloOplElementI@@PBD@Z) referenced in function "public: class IloOplElement __thiscall IloOplModel::getElement(char const *)" (?getElement@IloOplModel@@QAE?AVIloOplElement@@PBD@Z) Info.obj
    Error 79 error LNK2019: unresolved external symbol "public: void __thiscall IloOplModelI::generate(void)" (?generate@IloOplModelI@@QAEXXZ) referenced in function "public: void __thiscall IloOplModel::generate(void)" (?generate@IloOplModel@@QAEXXZ) Info.obj
    Error 80 error LNK2019: unresolved external symbol "public: void __thiscall IloOplModelI::postProcess(void)" (?postProcess@IloOplModelI@@QAEXXZ) referenced in function "public: void __thiscall IloOplModel::postProcess(void)" (?postProcess@IloOplModel@@QAEXXZ) Info.obj
    Error 81 error LNK2001: unresolved external symbol "public: virtual void __thiscall IloMapException::print(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?print@IloMapException@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) Info.obj
    Error 82 error LNK2019: unresolved external symbol "public: __thiscall IloOplModelDefinitionI::IloOplModelDefinitionI(class IloOplModelSourceI const &,class IloOplErrorHandlerI &)" (??0IloOplModelDefinitionI@@QAE@ABVIloOplModelSourceI@@AAVIloOplErrorHandlerI@@@Z) referenced in function "public: __thiscall IloOplModelDefinition::IloOplModelDefinition(class IloOplModelSource,class IloOplErrorHandler)" (??0IloOplModelDefinition@@QAE@VIloOplModelSource@@VIloOplErrorHandler@@@Z) Info.obj
    Error 83 error LNK2019: unresolved external symbol "public: __thiscall IloOplCplexModelI::IloOplCplexModelI(class IloEnvI *,class IloOplModelDefinitionI &,class IloCplexI &)" (??0IloOplCplexModelI@@QAE@PAVIloEnvI@@AAVIloOplModelDefinitionI@@AAVIloCplexI@@@Z) referenced in function "public: __thiscall IloOplModel::IloOplModel(class IloOplModelDefinition,class IloCplex)" (??0IloOplModel@@QAE@VIloOplModelDefinition@@VIloCplex@@@Z) Info.obj
    Error 84 error LNK2019: unresolved external symbol "public: __thiscall IloOplObject::IloOplObject(class IloOplObject const &)" (??0IloOplObject@@QAE@ABV0@@Z) referenced in function "public: __thiscall IloMapOutOfBoundException::IloMapOutOfBoundException(class IloMapOutOfBoundException const &)" (??0IloMapOutOfBoundException@@QAE@ABV0@@Z) Info.obj
    Error 85 error LNK2001: unresolved external symbol "public: virtual char const * __thiscall IloMapOutOfBoundException::getMessage(void)const " (?getMessage@IloMapOutOfBoundException@@UBEPBDXZ) Info.obj
    Error 86 error LNK2001: unresolved external symbol "public: virtual void __thiscall IloMapOutOfBoundException::print(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?print@IloMapOutOfBoundException@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z) Info.obj
    Error 87 error LNK2019: unresolved external symbol "public: __thiscall IloMapOutOfBoundException::IloMapOutOfBoundException(class IloAbstractMapI const *,class IloOplObject)" (??0IloMapOutOfBoundException@@QAE@PBVIloAbstractMapI@@VIloOplObject@@@Z) referenced in function "protected: long & __thiscall IloMap<long>::at(long)const " (?at@?$IloMap@J@@IBEAAJJ@Z) Info.obj
    Error 88 error LNK2019: unresolved external symbol "public: long __thiscall IloMapI::getAbsoluteIndex(class IloOplObject)const " (?getAbsoluteIndex@IloMapI@@QBEJVIloOplObject@@@Z) referenced in function "protected: long & __thiscall IloMap<long>::at(long)const " (?at@?$IloMap@J@@IBEAAJJ@Z) Info.obj
    Warning 89 warning LNK4088: image being generated due to /FORCE option; image may not run c:\Users\Patrick Fetue\Documents\Visual Studio 2005\CLSP\RunTestsCplex\Release\RunTests.exe 1
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: problem with IloOplModel class IloOplImplMissing

    Posted 01/14/13 05:15 AM

    Originally posted by: SystemAdmin


    The "unresolved external symbol" error means that there is a linking error with the CPLEX library. Are you using a development IDE for your project (like Visual Studio)?

    If so, you have to make sure the library is correctly linked: this page on the guide could help you http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r2/index.jsp?topic=%2Filog.odms.cplex.help%2FContent%2FOptimization%2FDocumentation%2FCPLEX%2F_pubskel%2FCPLEX18.htm

    Regards,
    Stefano
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: problem with IloOplModel class IloOplImplMissing

    Posted 02/14/13 07:24 AM

    Originally posted by: SystemAdmin


    Hi Guys, I had the same problem but different error. Can anyone help?

    The errors I got are included in the txt file. Please take a look and let me know if I am doing something wrong.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer