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

Failure to build project. with IVF 2022

BearofLittleBrain1
New Contributor I
246 Views

What am I doing wrong?  I have compiled all my User Library Files in D;|Lib with IVF 2022 and Utils.mod appears there.

Elsewhere I have successfully compiled DetectOS.f90, which contains a line: use Utils

For both DetectOS.f90 and the Project, Properties > Fortran > General > Additional Include Directories contain: D:\Lib

The compilation of DetectOS.f90 is successful and it is the only file in the Project.  However, when I rebuild the project, it comes up with errors that it cannot see a number of functions that are in Utils.mod.

How do I fix it please?

BearofLittleBrain

 

0 Kudos
1 Solution
BearofLittleBrain1
New Contributor I
183 Views

What worked or me was to change the settings on each library project, eg for the Maths library it is::

Properties > General > Output Directory                                                D:\Lib.

Properties > Fortran > General  > Additional Include Directories         D:\Lib.

Properties > Librarian > General > Output File                                    D:\Lib\Maths.lib

This gets the source files, the .mod files and the .lib files all in D:\Lib, which is where I want them.

I am sure other beginners in IVF will find this useful.

So, thanks, mecej4 - you set me on the right path.

Topic closed, I think.

BearofLittleBrain

 

 

 

View solution in original post

3 Replies
mecej4
Black Belt
238 Views

What did you do wrong? Not easy to reply, given that we were not standing around and watching! We can guess, however.

 

You are confusing include files, which are source files to be included by a preprocessor in other source files, and libraries, which are collections of compiled object files. Specifying D:\lib as an include directory enables the compiler to find .MOD files during compilation, but that is only one part of what is required.

 

You should specify D:\lib to be an additional library directory to search, and name the LIB files in that directory as additional libraries that the linker should process.

 

Given that your project has a small number of source files, you could have placed them all in one directory and let the build system deduce the dependencies and compilation order. If, however, you build the library separately, you have to tell VS that the EXE should be built using that library.

 

When reporting problems with building using Visual Studio, you should attach a copy of the build log file, along with any console error messages that you were given.

BearofLittleBrain1
New Contributor I
211 Views

mecej4,

Thanks for your reply - it reminds me of how much I have forgotten since CVF times.

It looks as if my problem is that the .lib library files are appearing in the relevant sub-directories of D:\Lib.  How do I get them to go automatically to D:\Lib?  I am very good at changing the wrong item in Properties > Fortran

BearofLittleBrain

BearofLittleBrain1
New Contributor I
184 Views

What worked or me was to change the settings on each library project, eg for the Maths library it is::

Properties > General > Output Directory                                                D:\Lib.

Properties > Fortran > General  > Additional Include Directories         D:\Lib.

Properties > Librarian > General > Output File                                    D:\Lib\Maths.lib

This gets the source files, the .mod files and the .lib files all in D:\Lib, which is where I want them.

I am sure other beginners in IVF will find this useful.

So, thanks, mecej4 - you set me on the right path.

Topic closed, I think.

BearofLittleBrain

 

 

 

Reply