error: iostream.h due to including cplex

2019-01-25 17:37发布

I am trying to use cplex in eclipse in Ubuntu 12.04 but when I include ilocplex.h I get the following error

/opt/ibm/ILOG/CPLEX_Studio124/concert/include/ilconcert/ilosys.h:360:22: fatal error: iostream.h: No such file or directory

The only two includes are written as follows:

#include <ilcplex/ilocplex.h>
#include <iostream>

I would appreciate if anyone could help me with this.

3条回答
淡お忘
2楼-- · 2019-01-25 18:26

Apparently cplex is utterly outdated, iostream.h predates every C++ standard.

查看更多
我命由我不由天
3楼-- · 2019-01-25 18:32

At the time ILOG's Concert library was first released, the older iostream.h headers were still common in C++ compilers, but it supports the standard iostream libraries. To use the standard headers and libraries, you need to define the IL_STD preprocessor symbol. Instructions for defining preprocessor directives in Eclipse/C++ can be found in this question.

查看更多
Root(大扎)
4楼-- · 2019-01-25 18:34

Try reading the manual again or look again at the samples. Cplex has supported both the old style iostream.h and the newer C++ iostream standard for at least a decade. I just don't have the manual with me right now to give the full reference.

查看更多
登录 后发表回答