FILE _iob[] = { *stdin, *stdout, *stderr };
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
Success! Subscription added.
Success! Subscription removed.
Sorry, you must verify to complete this action. Please click the verification link in your email. You may re-send via your profile.
i read many posts about this problems like
and i got the solutions based on C++ : put the words in the C++ script
FILE _iob[] = { *stdin, *stdout, *stderr };
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
I think this problem is caused by an incompatibility Microsoft introduced in Visual C++ for VS2015. Objects compiled with earlier versions of Visual C++ can't link with the VS2015 static libraries (and vice versa). Intel Visual Fortran works around this in a rather complicated way as far as the Fortran library is concerned, but this doesn't help with C/C++ sources that make direct references to C library globals.
If you can't recompile all the C/C++ code in the newer Visual C++, then the only thing I can suggest is to back off to VS2013 if you can. This is not an Intel Fortran problem. Note that unlike Intel Fortran, Microsoft Visual C++ generates different object code depending on your setting of the run-time library selection.
Link Copied
You probably have some OBJ files that were compiled with /MD and some with /MT (or /libs:static and /libs:dll or equivalent directives in your code). As a result, some of the code expects to be linked with one version of the RTL (run time library) and the rest expects another version. Or, you have some third party library that you are using which expects one RTL and your code the other.
Find out what your third party library expects, and recompile to match. If you do not use such a library, simply recompile all your sources with the same compiler options and build.
You do not need to write C++ code in an attempt to solve the problem.
mecej4 wrote:
You probably have some OBJ files that were compiled with /MD and some with /MT (or /libs:static and /libs:dll or equivalent directives in your code). As a result, some of the code expects to be linked with one version of the RTL (run time library) and the rest expects another version. Or, you have some third party library that you are using which expects one RTL and your code the other.
Find out what your third party library expects, and recompile to match. If you do not use such a library, simply recompile all your sources with the same compiler options and build.
You do not need to write C++ code in an attempt to solve the problem.
although i really doesn't want to recompile the third library, i think i have to do that after reading you suggestions
anyway thank you for your detailed explanation
i learned much!
You don't have to recompile the third party library, even if you have the source code for it, unless you deliberately decide that it is beneficial to do so.
Simply find out what option was used when the library was built, and simply use that option when compiling your code and linking with the library. Usually, the documentation that came with the library will clearly state what you need to do to use the library with your code.
I think this problem is caused by an incompatibility Microsoft introduced in Visual C++ for VS2015. Objects compiled with earlier versions of Visual C++ can't link with the VS2015 static libraries (and vice versa). Intel Visual Fortran works around this in a rather complicated way as far as the Fortran library is concerned, but this doesn't help with C/C++ sources that make direct references to C library globals.
If you can't recompile all the C/C++ code in the newer Visual C++, then the only thing I can suggest is to back off to VS2013 if you can. This is not an Intel Fortran problem. Note that unlike Intel Fortran, Microsoft Visual C++ generates different object code depending on your setting of the run-time library selection.
Steve Lionel (Intel) wrote:i have decided to embrace the future and started the big compiling work. thank you for your suggestion!
I think this problem is caused by an incompatibility Microsoft introduced in Visual C++ for VS2015. Objects compiled with earlier versions of Visual C++ can't link with the VS2015 static libraries (and vice versa). Intel Visual Fortran works around this in a rather complicated way as far as the Fortran library is concerned, but this doesn't help with C/C++ sources that make direct references to C library globals.
If you can't recompile all the C/C++ code in the newer Visual C++, then the only thing I can suggest is to back off to VS2013 if you can. This is not an Intel Fortran problem. Note that unlike Intel Fortran, Microsoft Visual C++ generates different object code depending on your setting of the run-time library selection.
I had this same issue with the old IMSL libary. I use this code in VS2015 compiled as an object library linked into my Fortran exe:
#include "stdio.h"
extern "C" { FILE _iob[3] = {__acrt_iob_func(0), __acrt_iob_func(1), __acrt_iob_func(2)}; }
Andrew Smith wrote:
I had this same issue with the old IMSL libary. I use this code in VS2015 compiled as an object library linked into my Fortran exe:
#include "stdio.h"
extern "C" { FILE _iob[3] = {__acrt_iob_func(0), __acrt_iob_func(1), __acrt_iob_func(2)}; }
oh, i got it!
i failed with the code you paste, but i succeeded with mine
ps: it takes me much time to understand the .pch in vc++ project and disable it
Community support is provided during standard business hours (Monday to Friday 7AM - 5PM PST). Other contact methods are available here.
Intel does not verify all solutions, including but not limited to any file transfers that may appear in this community. Accordingly, Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.
For more complete information about compiler optimizations, see our Optimization Notice.