Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  IOSTREAM error - need help

    Posted Sat August 01, 2009 09:07 AM

    Originally posted by: SystemAdmin


    [ddrayton said:]

    Hello.

    I have a code with "#include <iostream>" and "using namespace std;".

    For some reason I'm getting a "ilosys.h:399:23: error: iostream.h: No such file or directory", "ilosys.h:401:22: error: fstream.h: No such file or directory", "ilosys.h:403:22: error: iomanip.h: No such file or directory" and "ilosys.h:407:25: error: strstream.h: No such file or directory".

    I'm completely lost here... tried many different things, but nothing worked.

    Any suggestion on how to fix it? At least some suggestion of where should I investigate?

    Thanks.


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: IOSTREAM error - need help

    Posted Sun August 02, 2009 01:22 AM

    Originally posted by: SystemAdmin


    [shaw said:]

    Hello,

    Can you check that you have IL_STD defined when compiling, for example via -DIL_STD
    (UNIX), or by placing it in the definitions for Visual Studio?


    Paul
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: IOSTREAM error - need help

    Posted Fri December 10, 2010 01:24 AM

    Originally posted by: Cormac_Cork


    Hi,

    Further to this post, I'm encountering the same problem I'm afraid:

    "fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory"

    I've configured Visual Studio (2010 Express) as per the instructions provided in <installDir>cpp.html and <installDir>readmeWindows.html. IL_STD is in the preprocessor definitions.

    The #include for iostream.h is in <installDir>\concert\include\ilconcert\ilosys.h

    I'm reviving C++ code that was last successfully compiled circa 2006 under VS 2003 and Solver60. Sln was successfully imported into VS2010E and code/reference changes made to reflect Concert and CPOptimizer changes between Solver60 and CPLEX Studio 122.

    I'm not a regular C++ programmer but I understand there have been changes to how C++ header files are handled? Could the above have something to do with these changes?

    Note also:
    1. I'm using Visual Studio 2010 Express & CPLEX Studio 122
    2. I'm linking to the <installDir>\cpoptimizer\lib\x86_windows_vs2008\stat_mda\ libraries
    3. The only variation from the instructions in cpp.html is the "Debug Information format" is set to Program Database (/Zi) instead of /Zd

    Could any of 1-3 above be causing the problem? I'm conscious VS 2010 Expresss is not in the list of compatible IDEs in mpp.html.

    Any pointers appreciated.

    BR
    Cormac
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: IOSTREAM error - need help

    Posted Mon December 13, 2010 07:54 PM

    Originally posted by: GuangFeng


    A few things to notice:
    1. You are using VS 2010 and the libraries are for VS 2008. You'd better use VS 2008 as the compiler or use the set of libraries for VS 2010 to make sure the versions of the compiler and the libraries match. Actually, I suggest you start from trying to compile the samples first and make sure you can compile, link and run the samples. If that is successful, you can try to reuse the sample project file or duplicate the settings in the sample project file in your own projects.
    2. You will probably have to recompile every component (libs, dlls, executables, etc).
    3. Your old application is based on Solver 6.0. IBM ILOG CP is the package that includes Solver. You may not be able to compile and link your applications correctly with CP Optimizer.
    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: IOSTREAM error - need help

    Posted Tue December 28, 2010 03:29 AM

    Originally posted by: Cormac_Cork


    Hi,

    Thanks to both GuangFeng and GGR for your responses/suggestions...

    I am now running VS2008 and ILOG CP 1.6. All 50 examples supplied with CP16 compile successfully.

    I have copied the compiler, linker and includes settings etc. used in the examples to my project. Unfortunately I continue to have precisely the same problem when I attempt to compile my project e.g.:

    "1>C:\ILOG\cp16\concert\include\ilconcert/ilosys.h(394) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory"

    Clearly there is still something wrong with the preprocessor/compiler/linker configuration in my project...

    Solutions offered on the web for this error all suggest changing <iostream.h> to <iostream>, including "use namespace std" and so on in the affected header file but this would mean changing the ILOG header files - clearly that shouldn't be necessary as the examples work OK...

    The only substantive difference between the examples and my project is mine is
    a dll and not an exe. Obviously there are certain differences in the configuration as a result, but could this have something to do with the error? I don't see how...

    Can anyone throw some light on this?

    BR
    Cormac, Cork.
    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: IOSTREAM error - need help

    Posted Wed December 29, 2010 03:56 AM

    Originally posted by: Paul Shaw


    Hello,

    The symptoms look like you are not defining IL_STD (which is needed for compilers using new style headers).
    Can you make sure that you specify -DIL_STD to the compiler?

    Regards,
    Paul
    #CPOptimizer
    #DecisionOptimization


  • 7.  Re: IOSTREAM error - need help

    Posted Wed December 29, 2010 04:51 AM

    Originally posted by: Cormac_Cork


    Paul,

    Your instincts were absolutely correct - see my other post for the explanation. Thanks for your help.

    BR
    Cormac
    #CPOptimizer
    #DecisionOptimization


  • 8.  Re: IOSTREAM error - need help:: RESOLVED

    Posted Wed December 29, 2010 04:49 AM

    Originally posted by: Cormac_Cork


    Hi,

    Just a note to advise this issue is resolved.

    The cause was uncovered when I began removing preprocessor directives one by one and re-compiling to try and get a handle on what was going on - the result? Absolutely no change in compiler output i.e. removing directives was having no effect on compiler behaviour... Here's why:

    My Visual Studio projects were "upgraded" from VC6 to VC9 by VC9. Unfortunatey the result (in the case of my projects) was a project settings mess that simply didn't work following the upgrade. When compiling the upgraded project, VC9 continued to use some of the settings from the old project. I could change these settings in the new project e.g. preprocessor directives, but VC9 continued to compile using the old information. Investigations on the web suggest this is not an uncommon problem when VS upgrades older projects.

    In the case cited here, the iostream.h error was being caused by the fact that the old settings, which excluded the IL_STD directive, were not being overwritten by the changes I'd made in the upgraded VC9 project i.e. when I included the IL_STD directive it was not being passed to the compiler by VC9 despite all indications in the VC9 project indicating that it was - this only became apparent when I opened the upgraded VC9 project file in a text editor to find that IL_STD was missing from the preprocessor directives list. A pile of other projet information was also incorrect.

    Resolution; I threw out all the "upgraded" VC projects and created new projects in VC9 re-using only the source code from the earlier work. Hey Presto, everything now works beautifully...

    BR
    Cormac
    #CPOptimizer
    #DecisionOptimization


  • 9.  Re: IOSTREAM error - need help

    Posted Tue December 14, 2010 09:30 AM

    Originally posted by: GGR


    Hi

    In practice, will not be able at all to link with CP Optimizer from solver 6.0. You first needs to upgrade your application with the last cp version: cp 1.6 (which contains solver 6.8). Furthermore, cp 1.6 is available on Microsoft Visual Studio 2010 C++ compiler.
    Then, to be able to compile and link with CP Optimizer, The last version Cplex Optimization Studio 12.2 is required: cp 1.6 and COS 12.2 share the same IBM Ilog Concert modeling library. COS 12.2 is also available on 2010 Microsoft Visual Studio 2010 C++ compiler.

    Last, you imperatively must not include in the same of your own source files solver (nor scheduler, dispatcher) include files and CP Optimizer include files. Note there is not such conflict with concert include files.

    Hope that helps
    #CPOptimizer
    #DecisionOptimization


  • 10.  Re: IOSTREAM error - need help

    Posted Sun March 02, 2014 12:59 PM

    Originally posted by: Almakhawi


    Hello,

    i have the same problem , i m using visual c++ 2012 express and Cplex studio 12.5.. i have edited the project properites-->c/c++ --> pre processor--> preprocessor definitions add IL_STD. this will resolve the conlict  for the .h files.

     


    #CPOptimizer
    #DecisionOptimization