FILE _iob[] = { *stdin, *stdout, *stderr };
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
成功! 購読を追加しました。
成功! 購読を解除しました。
この操作を完了するには認証が必要です。お手数ですが、メール内の認証リンクをクリックしてください。次のリンクから再送信できます。 プロファイル.
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.
コピーされたリンク
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
コミュニティーのサポートは、月曜日から金曜日まで提供されています。その他の連絡方法については、 こちらをご覧ください。
インテルは、すべてのソリューションを検証するものではありません。ここにいうソリューションには、このコミュニティーで行われる可能性のある、あらゆるファイル転送が含まれますが、これに限定されません。したがって、インテルは、明示されているか否かにかかわらず、いかなる保証もいたしません。ここにいう保証には、商品適格性、特定目的への適合性、および非侵害性の黙示の保証、ならびに履行の過程、取引の過程、または取引での使用から生じるあらゆる保証を含みますが、これらに限定されるわけではありません。
コンパイラーの最適化について、さらに詳しい情報をお知りになりたい場合は、以下を参照してください: 最適化に関する注意事項.