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

Library problem

cdetech
Beginner
515 Views
I am trying to compile a project under Cygwin(don't know if it matters in this case), and am having a problem getting .lib files to work.

I compile the fortran files with the following options;
ifort /nologo /Zi /libs:static /Od /c /object:i1mach.i i1mach.f

I create the library file with the following line;
lib /out:libncarg_c.lib options.o misc.o ncarg_path.o version.o error.o atoargv.o usleep.o env.o trnspprt.o lblank.o iargct.o rwchinfl.o sdbm.o i1mach.o r1mach.o d1mach.o bcopyswap.o gsbytes.o logic32.o argget.o

I later try to create the target using the lib file;
ifort /Od ccheck.o creb15.o crebin.o dport.o mkmsk.o pcrbin.o xtch.o /link /out:pwritxnt /libpath:../../../.././ncarg2d/src/libncarg /libpath:../../../.././common/src/libncarg_c /libpath:/usr/ncarg/lib /libpath:/usr/X11R6/lib

which gives me the error(among others);
mkmsk.o : error LNK2019: unresolved external symbol _I1MACH referenced in function _MKMSK

I checked the "libncarg_c.lib" and "mkmsk.o" with "dumpbin -symbols" and they both had _I1MACH identified as external. The compilation works when I copy the "i1mach.o" file to the same directory and add it to the ifort command, but that is not going to be possible.
0 Kudos
2 Replies
TimP
Honored Contributor III
515 Views
ifort and Microsoft link don't understand cygwin style path names, except with -unix switch. Another possible way is to use doubled backslashes, where the paths are plain Windows paths (no cygwin mounts....). Also, you may want to study the cygpath utility et al.
Possibly of interest, 32-bit static libraries are interchangeable with cygwin .a libraries.
0 Kudos
Steven_L_Intel1
Employee
515 Views
Actually, ifort does understand such path names - all you have to do is add the switch -unix as the leftmost option.
0 Kudos
Reply