Topic
  • 1 reply
  • Latest Post - ‏2013-03-01T12:59:24Z by SystemAdmin
SystemAdmin
SystemAdmin
1883 Posts

Pinned topic Problems with opl.end() and env.end()

‏2013-02-25T15:41:47Z |
My opl interface in c++ got stuck when it's calling either opl.end() or env.end(), and I couldn't find anything wrong with my codes, just to give you an idea:

IloEnv env;
IloOplErrorHandler handler(env, cout);
IloOplModelSource modelSource(env, ModFile.c_str());
IloOplSettings settings(env, handler);
IloOplModelDefinition def(modelSource, settings);
IloCplex cplex(env);

status = 127;
try {
IloOplModel opl(env,settings,def,cplex);
RCFDataSource externDS(env);
IloOplDataSource dataSource(&externDS);
opl.addDataSource(dataSource);
...
opl.generate();
cplex.solve();
opl.end();
}
catch {...}
env.end();
}

I also tried to end all other objects; they are fine except these two.
I would appreciate any suggestions. Thanks in advance.
Updated on 2013-03-01T12:59:24Z at 2013-03-01T12:59:24Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1883 Posts

    Re: Problems with opl.end() and env.end()

    ‏2013-03-01T12:59:24Z  
    This problem was caused by the heap corruption in some other part of my program. When I disabled that part, opl.end() and env.end() work fine.