Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  cplex.exportmodel

    Posted 05/15/14 08:09 PM

    Originally posted by: jarchit52


    I am using Microsoft Visual C++ 2010 and linked it with CPLEX. I tried to run ilosteel.cpp using command prompt  but an error is displayed CPLEX Error 1422: Could not open file steel.lp for writing. What can I do?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: cplex.exportmodel

    Posted 05/16/14 12:18 AM

    Could it be that you do not have permissions to create the file? Either because the file already exists and cannot be overwritten or because you are not allowed to write to the folder in which the program is run? Or is the disk full?

    What does function GetlLastError() return?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: cplex.exportmodel

    Posted 05/16/14 03:20 AM

    Originally posted by: jarchit52


    I am sorry. I am just a beginner. How to check the return value of the function GetLastError()


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: cplex.exportmodel

    Posted 05/16/14 08:03 AM

    This is just a standard Windows function. You can for example do the following right after catching the exception:

    std::cout << "GetLastError: " << GetLastError() << std::endl;
    

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: cplex.exportmodel

    Posted 05/16/14 11:53 AM

    Originally posted by: jarchit52


    Message displayed - General Failure. GetLastError returned 5


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: cplex.exportmodel

    Posted 05/16/14 12:11 PM

    Error 5 is "access denied" (see here). So it looks you are not allowed to write in this place?


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: cplex.exportmodel

    Posted 05/16/14 12:30 PM

    Originally posted by: jarchit52


    Thank you very much. Just ran the command prompt as administrator and it worked.


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: cplex.exportmodel

    Posted 05/16/14 12:44 PM

    Are you running the example from the default installation directory (e.g., under "Program Files")?  Or, are you running your personal copy of the example (e.g., under "C:\Documents and Settings\username\Documents\IBM\ILOG\CPLEX_Studio126")?  If you're not doing the later, I would suggest trying this.


    #CPLEXOptimizers
    #DecisionOptimization