FILE _iob[] = { *stdin, *stdout, *stderr };
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
¡Enhorabuena! Se ha añadido la suscripción.
¡Enhorabuena! Se ha eliminado la suscripción.
Lo sentimos, debe efectuar la verificación para completar esta acción. Haga clic en el enlace de verificación en su correo electrónico. Puede volver a enviar a través de su de comisión.
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.
Enlace copiado
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
La asistencia de la comunidad se proporciona de lunes a viernes. Existen otros métodos de contacto disponibles aquí.
Intel no verifica todas las soluciones, como las transferencias de archivos, entre otras, que puedan aparecer en esta comunidad. Por consiguiente, Intel renuncia a todas las garantías expresas e implícitas, incluidas, entre otras, las garantías implícitas de comerciabilidad, idoneidad para un propósito particular y cumplimiento, así como cualquier garantía derivada del transcurso de la ejecución, de la negociación o del uso en el comercio.
Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.