0

I use CPLEX 12.8 and c++ to code a benders decomposition algorithm. When I use clang++ compiler there is no error. However, when I use g++ the following error occurs:

In file included from /opt/ibm/ILOG/CPLEX_Studio128/cplex/include/ilcplex/ilocplexi.h:1053:0, from /opt/ibm/ILOG/CPLEX_Studio128/cplex/include/ilcplex/ilocplex.h:29,
from PARAM.h:12, from MAIN.cpp:1: /opt/ibm/ILOG/CPLEX_Studio128/cplex/include/ilcplex/iloparam.h:83:12: warning: ‘IloCplex::Param::MIP::Limits::SubMIPNodeLim’ is deprecated [-Wdeprecated-declarations] struct Limits { ^ /opt/ibm/ILOG/CPLEX_Studio128/cplex/include/ilcplex/iloparam.h:103:40: note: declared here static const IloCplex::LongParam SubMIPNodeLim = LongParam(CPX_PARAM_SUBM

I do not use SubMIPNodeLim in my code, so I don't understand why I am receiving this warning. Although g++ produces this kind of warning, it also compiles the code and I can see the results. However, when I use gcc it does not show any results and terminates with a long list of errors. Could you please let me know what is wrong here?

rasul
  • 1,009
  • 9
  • 14
  • 2
    What you have is not an error, but a *warning*. And you might be using some functionality which in turn uses the deprecated function. – Some programmer dude Mar 26 '18 at 10:39
  • 2
    @MikeKinghan The only difference between the `gcc` and `g++` programs are the default directories added to the include and library search paths and that `gcc` doesn't link with the C++ library. Otherwise both executes the same "backend" programs. Same with `clang` versus `clang++`. – Some programmer dude Mar 26 '18 at 11:15
  • @Someprogrammerdude I know. As I read it, I think this is actually a separate question and that he/she's referring to undefined reference linkage errors. – Mike Kinghan Mar 26 '18 at 11:20
  • @MikeKinghan: There is not even one single mention of undefined references in the question. You're off base. – Lightness Races in Orbit Mar 26 '18 at 11:32
  • @LightnessRacesinOrbit Indeed not. I think the OP is not well distinguishing the issue with g++ build from the issue with gcc build and has provided no diagnostics for the latter. Have no desire to argue the toss however. Comment deleted. – Mike Kinghan Mar 26 '18 at 11:39
  • @Someprogrammerdude Thanks. I can't find where in the code I have used such a functionality. Is there any way to detect that? Regarding the difference between compilers, now I somehow understand why gcc does not compile my C++ code properly. Comparing g++ and clang++, maybe clang++ can realize that I have not used the deprecated methods in my code (but g++ can't). Is that possible? – rasul Mar 26 '18 at 12:15
  • @MikeKinghan: There is no g++/gcc issue. You invented it in your head :) GCC is the name of the whole project/toolchain; don't confuse it with the `gcc` wrapper binary – Lightness Races in Orbit Mar 26 '18 at 12:28
  • @LightnessRacesinOrbit This is what I mean by the g++/gcc issue: "Although g++ produces this kind of warning, it also compiles the code and I can see the results. However, when I use gcc it does not show any results and terminates with a long list of errors" The issue is tagged gcc, g++, clang++ and draws a distinction about each. OP subsequently comments "now I somehow understand why gcc does not compile my C++ code properly. Comparing g++ and clang++ ..." – Mike Kinghan Mar 26 '18 at 14:16
  • @MikeKinghan: Er, okay, so what's happened here is that I appear to have had a stroke or something and didn't see that paragraph at all despite repeated re-reads. Sorry – Lightness Races in Orbit Mar 26 '18 at 14:18

1 Answers1

2

The parameter warning is only meant to be informative; the parameter in question is defined in the ilcplex/iloparam.h header file (which is included indirectly via ilcplex/ilocplex.h), so you'll see that warning even if you aren't using it directly. You can read more information about the deprecated parameter in the 12.8 release notes here. If you want, you can use the -Wno-deprecated compiler option to silence the warning (i.e., see the documentation here).

You can use gcc to compile C++ code, but you are likely getting a linker error (e.g., see this stackoverflow thread). However, using g++ should make your life easier.

rkersh
  • 4,447
  • 2
  • 22
  • 31