Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Problem using CPLEX callable library in eclipse cdt

    Posted Fri August 24, 2012 07:34 AM

    Originally posted by: SystemAdmin


    Hi everybody,

    I am using the CPLEX callable library in a C++ project with eclipse cdt.
    With CPLEX 12.2 it was working fine and I could compile and run everything.

    Now I wanted to switch to CPLEX 12.4 and just replaced the corresponding include-directory and libraries:

    Include-Dir: "C:\ILOG\CPLEX_Studio124\cplex\include"
    Library-Dir: "C:\ILOG\CPLEX_Studio124\cplex\lib\x86_windows_vs2010\stat_mda"
    Libraries: ilocplex, cplex124

    When I try to compile this (which used to work with 12.2), I get the following error message:

    "C:\ILOG\CPLEX_Studio124\cplex\include/ilcplex/cplex.h:903:1: error: expected ')' before 'deprecated'
    http://and about 50 more that have the same message but refer sometimes to different lines of cplex.h

    Does anybody know what changes from 12.2 to 12.4 that causes this problems, and how to solve it?

    Thanks a lot!

    Best,
    Stefan

    P.S.: I run it on a Windows XP with Eclipse CDT and MingGW as compiler
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Problem using CPLEX callable library in eclipse cdt

    Posted Sun August 26, 2012 04:43 AM

    Originally posted by: SystemAdmin


    I am pretty sure that mingw is not a compiler that is officially supported on Windows.
    In CPLEX 12.3 we added tags to the function definitions to mark deprecated functions (so that compilers can warn you if you use deprecated functions). These tags expand to something like
    __declspec(dllimport deprecated)
    

    on Windows and
    __attribute__ ((deprecated))
    

    on Linux (I don't know which one mingw would pick).
    It looks to me like the error messages say that mingw cannot handle this stuff properly. One option may be to try to "overwrite" this stuff by macros of the same name that just expand to nothing. But note that this still does not make mingw a supported compiler :-)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Problem using CPLEX callable library in eclipse cdt

    Posted Sun August 26, 2012 09:12 AM

    Originally posted by: T_O


    To get around your problem, open cpxconst.h and replace the long define-block starting with "Functions exported from the callable library are tagged with CPXLIBAPI." by:

    #define CPXLIBAPI
    #define CPXDEPRECATEDAPI
    #define CPXDEPRECATED
    Best regards,
    Thomas
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Problem using CPLEX callable library

    Posted Thu September 27, 2012 04:42 PM

    Originally posted by: Hambler


    I had the same problem in Dev-cpp. I tried almost every possible replacement, even:

    1. define CPXLIBAPI
    2. define CPXDEPRECATEDAPI
    3. define CPXDEPRECATED

    And got no success. Is there any hope?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Problem using CPLEX callable library

    Posted Mon October 01, 2012 10:57 AM

    Originally posted by: SystemAdmin


    If you define all the macros to be empty, what is the error message you get?
    Can you show us the section of cpxconst.h that you changed?
    #CPLEXOptimizers
    #DecisionOptimization