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

LINK : fatal error LNK1104: cannot open file 'ifmodintr.lib'

Ibrahim_K_
New Contributor I
6,399 Views

Friends:

I am trying to accomplish exactly the same as done here (use a Fortran generated library in another computer without Intel compiler)

https://software.intel.com/en-us/forums/intel-fortran-compiler/topic/394201

Steve provided there a link to an MSDN link for instructions. Unfortunately the link is now broken. Can somebody direct me in the right direction to merge what is required for my program to the LIB file created by my Fortran project?

Happy new year!

I. Konuk

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
6,399 Views

You have a bunch of Windows system DLLs in  c:\users\ibrahimkonuk_2\anaconda3\ , for example, \API-MS-WIN-CORE-RTLSUPPORT-L1-1-0.DLL. You should NEVER copy these DLLs into your own folders - this is a major (if not THE major) reason you're having difficulty. Delete them.

You have also copied Intel Fortran DLLs into this folder, which while not fatal, is not a good idea. You should instead install the redistributables package from https://software.intel.com/en-us/articles/intel-compilers-redistributable-libraries-by-version

View solution in original post

0 Kudos
10 Replies
Ibrahim_K_
New Contributor I
6,399 Views

I tried several solutions posted such as:

Add the Intel Fortran IA32LIB folder (for example, C:Program FilesIntelCompilerFortran9.0IA32Lib) to Tools..Options..Projects..VC++ Directories..Library Files.

also included alternatively the file or folder with full path in

Linker>General>Additional Library Dependencies

Linker>Input>Additional Dependencies

Also added the library name under:

Linker>Input>Ignore Specific Default Libraries

I always get the message.

Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK1104    cannot open file 'ifmodintr.lib'    PLDYNA    E:\AArea\ik20a\PLDYN17\CPPFort\PLDYNA\PLDYNA\LINK    1    
 

Always the same. If you notice the file linker is given by Visual Studio is different than what I specified. It seems to get t from project configuration somehow. I also edited the project configuration file. I notice that the changes I put on the Visual Studio project properties dialog are not reflected in the project configuration file.

I should mention that I copied the whole solution folder with C++ and Fortran projects to a new computer and removed the Fortran project and copied my Fortran static library location in the project configuration file. So it seems like somehow Visual Studio is very sensitive to messing around with projects. 

I. Konuk

 

 

0 Kudos
Steve_Lionel
Honored Contributor III
6,399 Views

Do I understand correctly that you're trying to build this on a system with Intel Fortran 9.0? That won't work, as the sources were compiled with a much newer (14 or 15) compiler. You must always use libraries at least as new as the compiler used to compile the sources.

0 Kudos
Ibrahim_K_
New Contributor I
6,399 Views

I am trying to re-build the identical (C++/Fortran) program on a system which does not have the Intel Fortran Compiler.

I have made some sort of progress. I went back to the computer with Intel Fortran. I removed the Fortran project via Visual Studio. Rebuilding the solution there works because location of Intel libraries are still in the configuration file. I copied the solution to the target computer. I edited the project file to indicate correct location of the static Fortran library which was created as part of the solution on the computer with the Intel Fortran. When I try to rebuild it, I got the same error  which is normal (but the file name it gives is really strange):

Error LNK1104 cannot open file 'ifconsol.lib' PLDYNA  E:\AArea\ik20a\WrapCPP\PLDYNA\PLDYNA\LINK 1

Then, I copies the libraray to the second machine. I edited the project configuration file via Visual Studio and inserted the path of the library in:

Linker>Additional Library Directories

lt build the program succesfully. When I tried to execute the EXE file without or with debugging, I get  error:

"The application was unable to start correctly (0xc000007b)."

Any suggestions how I could sort out the issue?

I. Konuk

 

 

0 Kudos
Ibrahim_K_
New Contributor I
6,399 Views

I ran the Dependency Walker on the EXE file and received the following summary:

Error: At least one required implicit or forwarded dependency was not found.

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.

Error: Modules with different CPU types were found.

Error: A circular dependency was detected.

Warning: At least one delay-load dependency module was not found.

Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

It seems like I am mixing x86 and x64 components. I can post the Dependency Walker logs for anyone who can read it.I am not sure why.

I am going to export Visual Studio settings from the original computer and import to the second machine and see if it will help.

0 Kudos
Steve_Lionel
Honored Contributor III
6,399 Views

In Dependency Walker, do a File..Save, put the .dws in a ZIP and attach here. The mixed architecture warnings may be false, as Dependency Walker stubbornly refuses to follow Windows X64's rule that skips over wrong-architecture DLLs. Delay-load dependency issues are typically not a problem, but a missing required dependency is.

0 Kudos
Ibrahim_K_
New Contributor I
6,399 Views

Steve Lionel (Ret.) (Blackbelt) wrote:

In Dependency Walker, do a File..Save, put the .dws in a ZIP and attach here. The mixed architecture warnings may be false, as Dependency Walker stubbornly refuses to follow Windows X64's rule that skips over wrong-architecture DLLs. Delay-load dependency issues are typically not a problem, but a missing required dependency is.

 

Thank you indeed very much. I am attaching the zipped DWI file Dependency Walker saved. I am also attaching a screen shot.

Cheers. 

I. Konuk

 

0 Kudos
Steve_Lionel
Honored Contributor III
6,400 Views

You have a bunch of Windows system DLLs in  c:\users\ibrahimkonuk_2\anaconda3\ , for example, \API-MS-WIN-CORE-RTLSUPPORT-L1-1-0.DLL. You should NEVER copy these DLLs into your own folders - this is a major (if not THE major) reason you're having difficulty. Delete them.

You have also copied Intel Fortran DLLs into this folder, which while not fatal, is not a good idea. You should instead install the redistributables package from https://software.intel.com/en-us/articles/intel-compilers-redistributable-libraries-by-version

0 Kudos
Ibrahim_K_
New Contributor I
6,399 Views

Steve Lionel (Ret.) (Blackbelt) wrote:

You have a bunch of Windows system DLLs in  c:\users\ibrahimkonuk_2\anaconda3\ , for example, \API-MS-WIN-CORE-RTLSUPPORT-L1-1-0.DLL. You should NEVER copy these DLLs into your own folders - this is a major (if not THE major) reason you're having difficulty. Delete them.

You have also copied Intel Fortran DLLs into this folder, which while not fatal, is not a good idea. You should instead install the redistributables package from https://software.intel.com/en-us/articles/intel-compilers-redistributabl...

 

Steve:

Thank you very much once again. 

O i normally never with system files in Windows. I took several OR courses here at the university (Princeton). We used Python and R for some of the projects. Looks like, I installed several version of each! In addition, the computer I am doing this test is a dual boot (Win & & 10). It looks like I did all the wrong things.

 

I uninstalled Python and R installations. The problem most went away. I am now getting missing DLL errors. I may have messed up VS 2017 installation during the process. I do not want waste your time till I reinstall VS 2017 and the redistributables and do a bit of more clean up.

Thank you again. I will report back tomorrow.

I. Konuk

0 Kudos
Ibrahim_K_
New Contributor I
6,399 Views

Steve:

A big THANK YOU! I owe you (once again) a huge gratitude). I am grateful that you are sticking around. Very few people (if any) left with your knowledge, experience and especially patience.

The current status is all is working. I cleaned up Windows 10 and reinstalled VS 2017. I also installed the redistributables. However, I still needed to copy the Intel Fotran library to the second computer. The redistributables package seems only to contain librray DLLs. I could not find the ia32_win libray files. Am I missing something?

Also, I tried to experiment with /lib:static and /static options on the original computer with the Intel Fortran compiler. It seems like these flags have no effect anymore (I am using version 19.5). Could you confirm if that is the case?

I have learned again a lot from this experience thanks due all to you.

Happy New year!

I. Konuk

0 Kudos
Steve_Lionel
Honored Contributor III
6,399 Views

/lib:static still works. /static is a synonym for that. But the issues you had weren't related to linking to the Intel DLLs (which you weren't.) 

 

0 Kudos
Reply