Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28859 Discussions

A error when link static library built with IFX

Haku
Novice
284 Views

I'm using Vsual Studio 2022 17.12.1 coding Fortran with newest oneAPI fortran compilers.
Firstly, i have a static library file build by IFORT (i.e. abc.lib)
Then I add the dependency in the main programs and build main codes with IFX without errors.
However, when I now change to IFX to build the static library file (abc.lib built successfully),
then build the same main programs the error shows up:

fatal error LNK1107: invalid or corrupt file: cannot read at 0x6BC9E
..\..\..\lib\abc.lib


what I changed is only from IFORT to IFX to build the static library file.
(notice the .lib file built by IFX is about 300kb while 4000kb by IFORT, seems some object files compiled by IFORT are larger than files by IFX)

Labels (1)
0 Kudos
1 Solution
Mark_Lewy
Valued Contributor I
260 Views

It's difficult to tell what is happening here without a minimal reproducible example.

I've been building static libraries with IFX 2025.0 on Windows without problems, but these are in projects that were converted from IFORT to IFX in earlier versions of OneAPI.

I also note that you are using a later version of VS 2022 than the validated version, 17.9.2.

Also, if you are mixing libraries built in both IFX and IFORT note that Interprocedural Optimisation (/Qipo) isn't supported (see the release notes).

 

View solution in original post

2 Replies
Mark_Lewy
Valued Contributor I
261 Views

It's difficult to tell what is happening here without a minimal reproducible example.

I've been building static libraries with IFX 2025.0 on Windows without problems, but these are in projects that were converted from IFORT to IFX in earlier versions of OneAPI.

I also note that you are using a later version of VS 2022 than the validated version, 17.9.2.

Also, if you are mixing libraries built in both IFX and IFORT note that Interprocedural Optimisation (/Qipo) isn't supported (see the release notes).

 

Haku
Novice
196 Views

@Mark_LewyThank you for your kind suggestions, when I disable /Qipo in static library building process it works without error.
But I'm still confused that although IFX and IFORT compatible is broken when use /Qipo, all the source files in static library project is built by IFX only, I can't understand that where did I mix the IFX and IFORT files.

0 Kudos
Reply