I have Microsoft visual studio 2008 and Intel Visual Fortran 11.0.72 installed on windows 10. I want to create a static library. When I compile the code on debug, the compilation process is successful and the .lib file is created. However, when I compile on release, the compilation fails with error
Error 1 error #7002: Error in opening the compiled module file. Check INCLUDE paths. [LIBRARYCONSTANTS] [Path to solution directory]\interfaces\createMatrixIdentity.inc 12
I am attaching a very small VS project which can replicate my problem. Thank you in advance for your help.
Here is some more information. To organize my code, I have created 3 directories in my solution directory
functions ---> where the functions/subroutines are kept
modules ----> where modules are kept
interfaces ----> where interfaces for the source codes in functions directory are kept
I have added the path to the interfaces directory in visual studio.
You have the sources for modules in the "modules" folder, but when the modules are compiled the created .mod file goes in the "intermediate" directory, which by default for your configuration is x64\release.
I don't have such an old version as you do, but your project builds fine for me with the 2019 (19.0) version, once I change your specific Additional Include Directory to the one on my PC.
What I see in your buildlog.htm is that the LibraryConstants.f90 file was not compiled before the module was used. The version you have is VERY old and I have a faint memory of compilation order issues in some older versions. The first thing to try is a Rebuild rather than Build of the solution. I also recommend that you enable viewing of hidden files in Windows Explorer and delete any hidden files in your solution/projecy folder. In VS2017 these have .suo and .u2d file types, but I am not sure if VS2008 uses those types. Then reopen the solution and do a Rebuild.
I have Ifort 11.1.072 still remaining on my PC, but it is no longer paired with any version of Visual Studio. I could build from the command line provided I presented the files in proper order (based on dependencies):
s:\lang\Ahmad\Lib1>ifort /c /Od /Iinterfaces modules\Precision.f90 modules\LibraryConstants.f90 modules\InterfacesLibraryMath.f90 functions\createMatrixIdentity.f90 Intel(R) Visual Fortran Intel(R) 64 Compiler Professional for applications running on Intel(R) 64, Version 11.1 Build 20101201 Package ID: w_cprof_p_11.1.072 Copyright (C) 1985-2010 Intel Corporation. All rights reserved.