问题描述
您好
我在Windows 7中使用Visual Studio 2015。
I am using Visual Studio 2015 in Windows 7.
我的代码包含Fortran和C ++代码。使用英特尔Fortran编译器2017将所有Fortran代码编译成一个lib文件.C ++代码由VS C ++编译并链接到此lib文件。对于编译到Win32,它完全是
好。
I have a code contains both Fortran and C++ codes. All the Fortran code is compiled into one lib file using Intel Fortran compiler 2017. The C++ code is compiled by VS C++ and link to this lib file. For compiling to Win32, it is completely good.
但是,对于编译到X64,存在一个问题。 Fortran编译器可以将所有Fortran代码编译成一个lib而不会出错,但是当将C ++代码链接到此lib时,它会显示"错误LNK1223无效或损坏的文件:文件包含无效的
.pdata贡献"。在这个lib文件中,并引用一个obj文件。
However, for compiling to X64, there is an issue. The Fortran compiler can compile all the Fortran code into one lib without error, but when link the C++ code to this lib, it shows "error LNK1223 invalid or corrupt file: file contains invalid .pdata contributions" in this lib file, and refer to a obj file.
我注意到如果Fortran代码文件太长(可能超过2000行),则会发生此错误。如果我随机删除长Fortran代码中的一些行(大约1000行),则此Fortran代码文件的错误消失,并引用另一个长Fortran
代码文件。我不能继续删除所有长Fortran代码文件的行。
I noticed that if the Fortran code file is too long (may be over 2000 lines), this error occurs. If I randomly delete some lines in the long Fortran code (around 1000 lines), then the error for this Fortran code file gone, and refers to another long Fortran code file. I cannot keep deleting lines for all the long Fortran code files.
它看起来链接无法正确读取Fortran编译的X64库。任何人都有LNK1223错误的经历?
It look the link cannot correctly read the Fortran compiled X64 lib. Anyone has experiences with LNK1223 error?
谢谢,
杰
推荐答案
这篇关于错误LNK1223文件无效或损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!