Topic
  • 9 replies
  • Latest Post - ‏2014-03-02T17:59:24Z by Almakhawi
SystemAdmin
SystemAdmin
554 Posts

Pinned topic IOSTREAM error - need help

‏2009-08-01T13:06:43Z |

[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.

Updated on 2010-12-29T09:51:10Z at 2010-12-29T09:51:10Z by Cormac_Cork
  • SystemAdmin
    SystemAdmin
    554 Posts

    Re: IOSTREAM error - need help

    ‏2009-08-02T05:21:48Z  

    [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
  • Cormac_Cork
    Cormac_Cork
    4 Posts

    Re: IOSTREAM error - need help

    ‏2010-12-10T06:23:55Z  

    [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
    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
  • GuangFeng
    GuangFeng
    1 Post

    Re: IOSTREAM error - need help

    ‏2010-12-14T00:53:33Z  
    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
    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.
  • GGR
    GGR
    70 Posts

    Re: IOSTREAM error - need help

    ‏2010-12-14T14:29:33Z  
    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
  • Cormac_Cork
    Cormac_Cork
    4 Posts

    Re: IOSTREAM error - need help

    ‏2010-12-28T08:29:07Z  
    • GuangFeng
    • ‏2010-12-14T00:53:33Z
    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.
    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.
  • Paul Shaw
    Paul Shaw
    7 Posts

    Re: IOSTREAM error - need help

    ‏2010-12-29T08:56:05Z  
    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.
    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
  • Cormac_Cork
    Cormac_Cork
    4 Posts

    Re: IOSTREAM error - need help:: RESOLVED

    ‏2010-12-29T09:49:05Z  
    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.
    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
  • Cormac_Cork
    Cormac_Cork
    4 Posts

    Re: IOSTREAM error - need help

    ‏2010-12-29T09:51:10Z  
    • Paul Shaw
    • ‏2010-12-29T08:56:05Z
    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
    Paul,

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

    BR
    Cormac
  • Almakhawi
    Almakhawi
    1 Post

    Re: IOSTREAM error - need help

    ‏2014-03-02T17:59:24Z  

    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.