I have a static library UTILIB.LIB built in Visual Studio project UTILIB that includes recursive subroutine REPLACE_STRING. I have a project with main program EDITLINE.FOR that calls routine REPLACE_STRING in UTILIB. If I add UTILIB.LIB to the EDITLINE project I can successfully build my executable. However, if I try to compile EDITLINE.FOR and link from the command line within the Intel Development window (C:\Program Files (x86)\Intel\Composer XE 2013 SP1>) it always fails with the LNK1120 unresolved external reference error for REPLACE_STRING. I have copied of both the main program EDITLINE.FOR and library UTILIB>LIB in the same folder. I have tried several things:
- adding complete path for my library(c:\fortran\UTILIB.LIB) to the LIB environment variable
- added the complete path to the ifort command: ifort c:\fortran\EDITLINE.FOR c:\fortran\UTILIB.LIB
- added a link option(getting desperate): ifort c:\fortran\EDITLINE.FOR /link c:\fortran\UTILIB.LIB
Any other suggestions? My PC configuration info is below. Thanks - Pat G.
DELL PC, Intel Core I5, 64-bit
Windows 7 Enterprise
Visual Studio 2010, 10.0.40219.1 SP1Rel