Originally posted by: SystemAdmin
[jp.dubus said:]
Hi everybody,
I have some compilation problem with the concert library for C++ interface of CPLEX, if i write that kind of code :
// This code is in the file "test.cpp"
#include <cstring>
#include <climits>
#include <ilcplex/ilocplex.h>
int main(int argc, char** argv) {
IloEnv env;
IloNumVarArray varArray(env, 1, - IloInfinity, IloInfinity);
IloExpr e;
e += varArray[0];
env.end();
return 0;
}
And if i'm trying to compile with :
g++ -o test -I/home/jp/ilog/cplex111/include/ -I/home/jp/ilog/concert26/include/ -L/home/jp/ilog/cplex111/lib/x86_debian4.0_4.1/static_pic/ -L/home/jp/ilog/concert26/lib/x86_debian4.0_4.1/static_pic/ -fPIC -fexceptions -m32 -DNDEBUG -DIL_STD -O -lcplex -lilocplex -lconcert -lm -lpthread test.cpp
The compilation failed with this output :
/tmp/cctZRRcg.o: In function `main':
test.cpp:(.text+0x76): undefined reference to `IloEnv::IloEnv()'
test.cpp:(.text+0xac): undefined reference to `IloNumVarArray::IloNumVarArray(IloEnv, long, double, double, IloNumVar::Type)'
test.cpp:(.text+0xcc): undefined reference to `IloExpr::operator+=(IloNumVar)'
test.cpp:(.text+0xdb): undefined reference to `IloEnvI::~IloEnvI()'
collect2: ld a retourné 1 code d'état d'exécution
Someone has an idea to solve this problem ?
Thank you very much,
Jean-Philippe Dubus
#CPLEXOptimizers#DecisionOptimization