Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

linking a library that contains modules

stuartbowman
Beginner
664 Views
Hi,
I have a static library that I am trying to link into a program I am creating. The .lib CONTAINs modules with functions and subroutines inside. When I compile the main program, I get the following compiler error: "Error: Error in opening the Library module file." It seems that the compiler is looking for the .mod files during the link process. I know this because the error went away when I copied the .mod files from the library folder and put them into the main program folder. Do I always have to manually put the .mod files into the compile path or is there just a setting somewhere that will do all this for me? Or does this have something to do with the way I linked the library?
Thanks for any light you can shed on this!

~Stuart
0 Kudos
3 Replies
stuartbowman
Beginner
664 Views
One point of clarification...
The library has modules that CONTAIN functions and subroutines, not what I said in the original post.
0 Kudos
Steven_L_Intel1
Employee
664 Views
The error is coming from the compiler, not the linker, and it is indeed looking for the .mod files. To specify that they are to come from some directory other than where the compiled source is, add the path under Preprocessor..INCLUDE/USE paths. While a library subproject does pull in the .LIB automatically when linking, it doesn't find the .MODs automatically.

Steve
0 Kudos
stuartbowman
Beginner
664 Views
Yup, that worked. The project compiles just fine now. Thank you!!

~Stuart
0 Kudos
Reply