Hello
I am trying to use for first time cplex with Microsoft Visual Studio. I have followed the installation process on this link (I have also included the cp.lib)
cplex config for MSVC
I have tried the following example included in the documentation
#include <ilcp/cp.h>
int main(int, const char* []) {
using namespace std;
IloEnv env;
try {
IloModel model(env);
IloIntVar x(env, 5, 12, "x");
IloIntVar y(env, 2, 17, "y");
model.add(x + y == 17);
model.add(x - y == 5);
IloCP cp(model);
cp.propagate();
cp.out() << std::endl << "Propagate:" << std::endl;
cp.out() << "x in " << cp.domain(x) << std::endl;
cp.out() << "y in " << cp.domain(y) << std::endl << std::endl;
if (cp.solve()) {
cp.out() << std::endl << "Solution:" << std::endl;
cp.out() << "x = " << cp.getValue(x) << std::endl;
cp.out() << "y = " << cp.getValue(y) << std::endl;
}
}
catch (IloException& ex) {
env.out() << "Error: " << ex << std::endl;
}
env.end();
return 0;
}
However I am getting a redefintion error of "longjmp" between the MSVC library VC\Tools\MSVC\14.29.30133\include\setjmp.h and cplex ilosys.h
What am I doing wrong?
Thanks in advance
------------------------------
javier rodrigo
------------------------------
#DecisionOptimization