Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

how to #include "ilcplex/ilocplex.h" in .h file

  • 1.  how to #include "ilcplex/ilocplex.h" in .h file

    Posted Fri April 18, 2014 06:31 AM

    Originally posted by: M9FH_Haris_Gavranovic


    I have the following problem:

    When I include in a header file (.h) in order to define a matrix, for example, 

    #include "ilcplex/ilocplex.h"
    ILOSTLBEGIN
    typedef IloArray<IloNumVarArray> NumVarMatrix;

    I have the following error from the compiler:

    /opt/ibm/ILOG/CPLEX_Enterprise_Server125/CPLEX_Studio/concert/include/ilconcert/ilosolution.h: At global scope:
    /opt/ibm/ILOG/CPLEX_Enterprise_Server125/CPLEX_Studio/concert/include/ilconcert/ilosolution.h:2755:17: error: expected identifier before numeric constant
    ....

    and many other errors.

    I I move everything in cpp file there is no compilation error. Could you please help me with this ? Am I doing something wrong?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: how to #include "ilcplex/ilocplex.h" in .h file

    Posted Tue April 22, 2014 04:27 AM

    What is the exact compiler command line you use? Does it help to add -DIL_STD to the compiler command?


    #CPLEXOptimizers
    #DecisionOptimization