Decision Optimization

Decision Optimization

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

 View Only
  • 1.  linking Cplex and c++ in eclipse

    Posted Sat April 09, 2011 04:28 AM

    Originally posted by: SystemAdmin


    Hi
    I am new to c++ and Cplex. I want to know how I can link Cplex header files in c++ programs ? I use Eclipse for C++ coding in Mac OS. I include the cplex and concert files but I got this error:

    • Build of configuration Debug for project test ****

    make all
    Building file: ../src/test.cpp
    Invoking: GCC C++ Compiler
    g++ -I/Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include -I/Users/eh/ilog/CPLEX_Studio_AcademicResearch122/cplex/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test.d" -MT"src/test.d" -o"src/test.o" "../src/test.cpp"
    In file included from /usr/include/c++/4.0.0/backward/iostream.h:31,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/ilosys.h:394,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/iloenv.h:21,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/iloalg.h:21,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/ilomodel.h:21,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/cplex/include/ilcplex/ilocplex.h:27,
    from ../src/test.cpp:10:
    /usr/include/c++/4.0.0/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
    In file included from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/iloenv.h:21,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/iloalg.h:21,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/ilomodel.h:21,
    from /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/cplex/include/ilcplex/ilocplex.h:27,
    from ../src/test.cpp:10:
    /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/ilosys.h:402:23: error: strstream.h: No such file or directory
    /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/ilosys.h:708: error: 'ostringstream' was not declared in this scope
    /Users/eh/ilog/CPLEX_Studio_AcademicResearch122/concert/include/ilconcert/ilosys.h:708: error: 'stream' was not declared in this scope
    make: *** http://src/test.o Error 1
    Thank you for your helps in advance !
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: linking Cplex and c++ in eclipse

    Posted Wed April 13, 2011 07:32 PM

    Originally posted by: SystemAdmin


    you should post CPLEX specific questions here:
    http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2059&start=0

    Probably the error is because you are missing IL_STD flag in compiler options...

    Regards,
    Faisal
    #DecisionOptimization
    #OPLusingCPLEXOptimizer